Learning C/C++ through exercises

  • Context: C/C++ 
  • Thread starter Thread starter Avatrin
  • Start date Start date
  • Tags Tags
    Book Exercises
Click For Summary

Discussion Overview

The discussion revolves around effective methods and resources for learning C and C++, particularly through exercises and practical applications. Participants share their experiences with different learning materials and approaches, expressing preferences for structured resources that emphasize hands-on practice.

Discussion Character

  • Exploratory
  • Technical explanation
  • Debate/contested
  • Homework-related

Main Points Raised

  • Some participants express frustration with learning programming languages through traditional textbooks, noting that they often skip content and struggle with unfamiliar syntax during exams.
  • Others advocate for resources like Codecademy, which provide bite-sized lessons followed by exercises, although they note that such platforms do not cover C or C++.
  • One participant recommends the Schaum's Outlines series for its emphasis on examples and exercises, specifically mentioning "Schaum's Outline of Programming with C++".
  • There is a suggestion that C and C++ are fundamentally different, with advice to focus on one language at a time to avoid confusion.
  • Some participants argue that learning C first can provide a solid foundation before transitioning to C++, especially regarding pointers and memory management.
  • Several resources are shared, including links to books and online materials, with varying levels of depth and structure, catering to different learning preferences.
  • One participant mentions a specific book that is fast-paced but suitable for someone with prior programming experience, suggesting it may be beneficial for the original poster.
  • Another participant shares links to online resources that provide concise explanations of C, although they note that one of the resources lacks exercises.

Areas of Agreement / Disagreement

Participants generally agree on the importance of practical exercises in learning programming but have differing opinions on the best approach to learning C and C++. There is no consensus on whether to learn C before C++, although several participants suggest it as a beneficial strategy.

Contextual Notes

Some participants highlight that the effectiveness of learning methods may depend on individual preferences, prior knowledge, and specific learning goals, indicating that there is no one-size-fits-all solution.

Who May Find This Useful

This discussion may be useful for individuals seeking to learn C or C++ through practical exercises, as well as those looking for recommendations on structured learning resources.

Avatrin
Messages
242
Reaction score
6
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++.
 
Technology news on Phys.org
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.
 
  • Like
Likes   Reactions: QuantumQuest
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.
 
  • Like
Likes   Reactions: QuantumQuest
Avatrin said:
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.

FactChecker said:
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.

jim mcnamara said:
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:
  • Like
Likes   Reactions: Avatrin and FactChecker
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!
 
Avatrin said:
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:
  • Like
Likes   Reactions: FactChecker

Similar threads

Replies
69
Views
11K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 31 ·
2
Replies
31
Views
3K
  • · Replies 13 ·
Replies
13
Views
6K
Replies
5
Views
8K
  • · Replies 5 ·
Replies
5
Views
7K
  • · Replies 17 ·
Replies
17
Views
2K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 16 ·
Replies
16
Views
2K