C++ is a superset of C, and C is a subset of C++. C++ was originally designed for the purpose of updating and adding OOP to C.
The main things C++ has that C doesn’t are user defined data types, support of reference variables, function overloading/overriding, built in exception handling with try/catch, inline functions, and C++ has around 30 more keywords overall.
I would say the biggest difference is the OOP focus of C++ where all of data and functions are encapsulated into an object. This helps make C++ more secure and better for writing high level implementations than C.
You are not logged in. However you can subscribe from another Fediverse account, for example Lemmy or Mastodon. To do this, paste the following into the search field of your instance: !programmerhumor@lemmy.ml
Post funny things about programming here! (Or just rant about your favourite programming language.)
Rules:
Posts must be relevant to programming, programmers, or computer science.
No NSFW content.
Jokes must be in good taste. No hate speech, bigotry, etc.
C++ is a superset of C, and C is a subset of C++. C++ was originally designed for the purpose of updating and adding OOP to C.
The main things C++ has that C doesn’t are user defined data types, support of reference variables, function overloading/overriding, built in exception handling with try/catch, inline functions, and C++ has around 30 more keywords overall.
I would say the biggest difference is the OOP focus of C++ where all of data and functions are encapsulated into an object. This helps make C++ more secure and better for writing high level implementations than C.
And namespaces! And strongly typed enumerators! And templates! And type deduction! And…!
Ahh so the whole create a object from a class thing actually works in native C++. So I can create child classes aswel and do cool stuff like casting.
Don’t laugh okay I thought C++ through Unreal Engine was vastly different from native C++ (because that’s what I learnt first)
Never actually used classes when I was playing with native C++. Couldn’t think of anything simple to make that would require it