r/CodingHelp • • Jul 31 '25

[C] Distinctive differences from C vs C++

Hi, I recently received one of those big coding books that teaches you from the basics to the more advanced parts of the language. Specifically, this is on C++. I'm going to be going to college soon for software development and part of the course involves learning C. Given the similarity in the names, would I be correct in assuming the C++ is sort of an extension of C? Sort of how C would be a foundation for both languages but C++ expands the commands in the language, or are they distinctive enough that there's a disconnect? Thanks!

1 Upvotes

7 comments sorted by

View all comments

Show parent comment

1

u/LogicalPerformer7637 Jul 31 '25

It is not needed to wait if you want to learn both. Despite C and C++ originating from same source, they have fundamentally different approach. In C, you are responsible for memory management, just pure functions and raw pointers. Although annoyinng it teaches you how it works under the hood. C++ is hidding this for you via smart pointers and object oriented approach. Don't be mistaken, it allows you to use the C approach, but there is no reason to use it.

Learning C first, teaches you how memory management works under the hood, shared (with C++) syntax, ... Then with C++, you build on top of it and switch approach from functions to objects.

Learning C++ will show you the "advanced" features. Then with C, you will understand the underlying details and you will need to adhere to some limitations of the C++ syntax which seem to be same in C and C++, e.g. C requires variables to be defined at begining of function, C++ allows you variable definition anywhere.

In general, C is simpler feature wise, fewer rules to learn, but more complicated due to memory management.

In the end, both languages allow you reach the same goal, just different way.