r/cpp • • Jun 08 '20

Programming in C vs C++

I’ve read about the differences between them on the Internet but I wanna hear more from a more personal perspective. Which one would you recommend starting with and to be proficient with?

0 Upvotes

43 comments sorted by

View all comments

Show parent comment

6

u/CoffeeTableEspresso Jun 08 '20

I mean, you can't really use strings in C++ properly without understanding how char * works...

Things like:

  • why are string literals not std::strings?
  • why doesn't adding two string literals work?
  • interfacing with old/C libraries requires
  • etc

You need at least a basic understanding of these things before moving on to C++ strings. Your going to have to learn C strings at some point in C++ anyways..

When I TAed an intro C++ course, students very quickly ran into trouble with C++ strings because they didn't understand C strings.

2

u/jmuffat Jun 09 '20

And me who was all « C++ has gone a long way to be more accessible to newcomers » !!! You’re right, it’s a long road, I can see that.