C/++/# Learning C/C++ through exercises

216
5
I often find it quite frustrating to learn a programming language through a book; I always find myself skipping through huge parts of the book I have to read before moving onto the exercises. That was the main reason I did not ace my Python exam at university; I was told to use syntax I hadn't even seen until exam. I had done most of the exercises, but apparently not the right ones.

However, I am quite fond of websites like Codeacademy; You get a bite-sized text to read before you are told to use it in an exercise. However, it does not go very in-depth. Also, it does not cover C or C++.

Are there books or other resources that are structured like that? This question is about C and C++.
 

FactChecker

Science Advisor
Gold Member
2018 Award
4,719
1,613
I have always been a big fan of the Schaum's Outlines series because it emphasizes examples and exercises. I have only used them for mathematics and physics subjects, but from the reviews, it seems like "Schaum's Outline of Programming with C++" is similar.
 

jim mcnamara

Mentor
3,435
1,626
Just a quick note: C and C++ are very different. Pick one to learn. Not both at the same time. Bad idea.

You can learn enough C in a few months to accomplish a many things. C++ has the STL, which takes a long time to learn. And this is a primary reason why the two languages take very different approaches to solving the same problem.
 

QuantumQuest

Science Advisor
Insights Author
Gold Member
830
429
I often find it quite frustrating to learn a programming language through a book; I always find myself skipping through huge parts of the book I have to read before moving onto the exercises. That was the main reason I did not ace my Python exam at university; I was told to use syntax I hadn't even seen until exam. I had done most of the exercises, but apparently not the right ones.
It maybe somewhat frustrating to learn from a textbook but this depends on various factors, like how much anyone likes programming so how much he/she is willing to spend time and efforts, how much time he/she has available, in what way he/she learns best and last but not least, if there is some time deadline like preparing for an exam or anything else. Although all these are quite understandable and more or less we've all been through similar conditions, the fact is that you can learn very well from a textbook, throwing enough code tinkering/experimenting and lots of problems and exercises into the mix and based on the procedure think - design - implement, with the design process being the most important, if you want to go way further. Now, you can of course learn by doing like Codecademy you mention but even this way, a textbook is again a precious guide otherwise you won't go anywhere beyond the basics. I would also suggest taking some online class for programming in any language you prefer - many mainstream languages are available, if you have the time to do so. Coursera is a good place to take a look at, edX is another one. I have taken lots of courses in Coursera in the past and I would even point you particularly to Programming Languages taught by the great Dan Grossman (University of Washington), if you want to learn the gist about functional programming concepts in the right way taught by an expert.

I have always been a big fan of the Schaum's Outlines series because it emphasizes examples and exercises. I have only used them for mathematics and physics subjects, but from the reviews, it seems like "Schaum's Outline of Programming with C++" is similar.
I like Schaum's Outlines too and I have used Programming with C and Programming with C++ in the past, among others. They're really great in that they give the essential outline of the main concepts and have lots of exercises and problems, so I highly recommend them too.

Just a quick note: C and C++ are very different. Pick one to learn. Not both at the same time. Bad idea.

You can learn enough C in a few months to accomplish a many things. C++ has the STL, which takes a long time to learn. And this is a primary reason why the two languages take very different approaches to solving the same problem.
I also highly agree with what jim mcnamara says. Although not necessary to learn C first and then C++, it is good to do so if you want to get in the world of the C family of languages the right way. When you reach the point of good grasping of pointers and dynamic allocation of memory in general and some complex data structures, you can migrate to the C++ monster ?:)- talked in a good sense:wink:.
 
Last edited:
Last edited by a moderator:
http://publications.gbdirect.co.uk/c_book/
The explanations are good, and not too long. I think it has a good structure.

You can find an even shorter intro to C here: http://cslibrary.stanford.edu/ ("Essential C") it doesn't have exercises though (use the book above for exercises?).
What is even more interesting is the "pointers and memory" pdf, I think it's really good.

Advice from someone who had both C and C++ courses: start with C, learn about object oriented programming, then start with C++, at least that worked for me.

I hope these resources will help you!
 
I often find it quite frustrating to learn a programming language through a book; I always find myself skipping through huge parts of the book I have to read before moving onto the exercises. That was the main reason I did not ace my Python exam at university; I was told to use syntax I hadn't even seen until exam. I had done most of the exercises, but apparently not the right ones.

However, I am quite fond of websites like Codeacademy; You get a bite-sized text to read before you are told to use it in an exercise. However, it does not go very in-depth. Also, it does not cover C or C++.

Are there books or other resources that are structured like that? This question is about C and C++.
From C, many programmers either move on to Java or C++. By learning C first, programmers can become acclimated to the procedural side of the language and then learn object-oriented programming through C++. C++ is more complicated thanC and can be overwhelming for a beginner.
 
Last edited by a moderator:

Want to reply to this thread?

"Learning C/C++ through exercises" You must log in or register to reply here.

Physics Forums Values

We Value Quality
• Topics based on mainstream science
• Proper English grammar and spelling
We Value Civility
• Positive and compassionate attitudes
• Patience while debating
We Value Productivity
• Disciplined to remain on-topic
• Recognition of own weaknesses
• Solo and co-op problem solving
Top