C/C++ Suggested books to supplement learning C and C++ programing?

AI Thread Summary
When learning C and C++, it's advisable to focus on one language at a time to avoid confusion, as they have significant differences despite C++ being derived from C. Beginners may find Deitel's books helpful, while more experienced programmers might benefit from Bjarne Stroustrup's classic texts or "Accelerated C++". For those programming microcontrollers, starting with C is recommended, as it is more commonly used in that context. Various online resources and free courses are available to supplement learning. Ultimately, understanding the distinct nature of C and C++ is crucial for effective learning.
KonaGorrila
Messages
12
Reaction score
0
Aloha, I am wanting to teach myself C and C++ programming languages and before I purchase any books or materials on the subject. I would like to see if anyone has any recommendations?, and the pros and cons if any, ect.
 
Technology news on Phys.org
KonaGorrila said:
I am wanting to teach myself C and C++
I recommend that you choose one and stick with it long enough to be comfortable with at least its basic features, before starting on the other one. Even though C++ evolved from C, as a sort of "C with object-oriented programming added on", there are significant differences even at the beginning level (i.e. C versus C++ without the object-oriented stuff). You'll probably get confused if you switch between C and C++ books or tutorials.

I used to teach an intro programming course using C++, but it was long enough ago that I'm not familiar with the currently available books etc.

Are you new to programming, or are you already acquainted with some other procedural programming language? (e.g. Python, Fortran, BASIC, Java,...)
 
If you know some programming then I recommend you get the White Book

https://www.amazon.com/dp/0131101633/?tag=pfamazon01-20

and just do programming examples yourself as you move through the book

If you do NOT already know some programming then the White Book may be too dense and you should probably find something else.
 
  • Like
Likes jim mcnamara and FactChecker
KonaGorrila said:
Aloha, I am wanting to teach myself C and C++ programming languages and before I purchase any books or materials on the subject. I would like to see if anyone has any recommendations?, and the pros and cons if any, ect.

Your background, your goal(s) and the time you can / are willing to spend are the crucial factors. In any case, learning C is a worthy thing to do, that will pay you back in the future. On the other hand, according to your experience and goal(s), it may be a better suit to dive directly into C++.

For textbooks, if you are now beginning programming, I recommend Deitel's books for C and C++. These books serve very well if you're not a beginner too but in this case I also recommend the book that phinds and Mark44 do.
 
QuantumQuest said:
... according to your experience and goal(s), it may be a better suit to dive directly into C++.
You might be right but personally, I cannot IMAGINE how this would be a good idea regardless of experience and goals. The underlying syntax of C++ IS C and adding in OPP concepts at the start just confuses things and detracts from learning the language.
 
phinds said:
You might be right but personally, I cannot IMAGINE how this would be a good idea regardless of experience and goals. The underlying syntax of C++ IS C and adding in OPP concepts at the start just confuses things and detracts from learning the language.

Yes, I agree if someone is taught this way but what I mean is learning directly C++, beginning only from the pure procedural things and then learning about objects (late objects approach). This, as far as I know, is done in a number of schools or even a self learner can follow the approach. So, effectively someone learns C aspects of C++ and then goes on to OOP. The difference is that learner goes in a faster pace than learning pure C first and it may work well if someone wants to work with OO C++ as soon as possible - although "soon" here is fairly long anyway.
 
QuantumQuest said:
Yes, I agree if someone is taught this way but what I mean is learning directly C++, beginning only from the pure procedural things and then learning about objects (late objects approach). This, as far as I know, is done in a number of schools or even a self learner can follow the approach. So, effectively someone learns C aspects of C++ and then goes on to OOP. The difference is that learner goes in a faster pace than learning pure C first and it may work well if someone wants to work with OO C++ as soon as possible - although "soon" here is fairly long anyway.
OK, that makes sense. We're essentially saying the same thing.
 
  • Like
Likes QuantumQuest
  • #10
When I taught C++, I did not start on object-oriented programming (object design and implementation) until the second semester. The complexity of OOP programming is not an issue until you start to tackle problems where OOP is helpful.

In my opinion the non-OOP subset of C++ is easier for beginning programmers to handle, in some respects, than C. First, C++ iostreams are easier to use for simple input and output than C's I/O functions. Second, C++'s standard string data type is easier to use than C's char arrays, especially if you want dynamically sized strings. Third, C++'s vectors have some advantages over C's arrays in general, especially (again) if the desired size is not known until run-time. (Maybe C has caught up in this area since the mid 2000s? I know there have been new versions of both the C and C++ standards since then.)
 
  • #11
jtbell said:
I recommend that you choose one and stick with it long enough to be comfortable with at least its basic features, before starting on the other one. Even though C++ evolved from C, as a sort of "C with object-oriented programming added on", there are significant differences even at the beginning level (i.e. C versus C++ without the object-oriented stuff). You'll probably get confused if you switch between C and C++ books or tutorials.

I used to teach an intro programming course using C++, but it was long enough ago that I'm not familiar with the currently available books etc.

Are you new to programming, or are you already acquainted with some other procedural programming language? (e.g. Python, Fortran, BASIC, Java,...)
I am sufficient in MatLab and have started to pick up some of python. My purpose is using programming skills in my family business, I want to learn C++ and C. I will be programing micro controllers at first but want to get into more than that so feel C++ would be more beneficial in the long run.
 
  • #13
Thanks ChrisVer, I really appreciate the links they are very helpful!
 
  • #14
KonaGorrila said:
Aloha, I am wanting to teach myself C and C++ programming languages and before I purchase any books or materials on the subject. I would like to see if anyone has any recommendations?, and the pros and cons if any, ect.
There a lot of free courses on coursera: https://www.coursera.org/courses?languages=en&query=c+programming

Here is a list of the best books for C for all lvls: https://stackoverflow.com/questions/562303/the-definitive-c-book-guide-and-list
and for C++: https://stackoverflow.com/questions/388242/the-definitive-c-book-guide-and-list
 
  • #15
KonaGorrila said:
I am sufficient in MatLab and have started to pick up some of python. My purpose is using programming skills in my family business, I want to learn C++ and C. I will be programing micro controllers at first but want to get into more than that so feel C++ would be more beneficial in the long run.
If you are going to be programming microcontrollers then you will most likely not be using C++.

Edit: C and C++ are different languages and should be treated as such. If you need to immediately program microcontrollers, learn C. You can learn C++ later when you need to do other things (I recommend "Accelerated C++" for this. It teaches C++ and not "C with classes")
 
  • Like
Likes jim mcnamara
  • #16
Let's let this thread go to rest. @vancouver_water pointed out something very important C and C++ are not alike and lead to confusion trying to learn both at the same time.
 
  • Like
Likes ISamson
Back
Top