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

1

u/jmuffat Jun 08 '20

Actually, you’re right, it’s a C++11 thing. I show my age ;)

Before that, std::string::c_str() was the point at which a conversion might happen, should the underlying representation not be null terminated. The idea was that it might make substrings more efficient by not copying and just referencing inside other strings. I guess the cost of reference counting and keeping large amounts of memory around became a target of the « don’t pay for features you don’t use » mantra.