I have read in tutorials that C++ contains the entire C programming language.
However I have also read, in places like this that
If you learn C++ you will eventually learn most of C with some differences between the languages that you will learn over time.
No, C++ is not a superset of the C language. While C++ contains a large part of C, there are subtle difference that can bite you badly where you least expect them. Here are some examples:
voidpointers to variables of concrete type.
intrule,” which, although abolished with C99, appears some times and needs to be considered.
a ? b : c = dis a syntax error in C but parsed as
a ? b : (c = d)in C++.
&*Eis exactly identical to
E, even if
Eis a null pointer. C++ has no such guarantee.
char foo = "bar"is legal). In C++, the array has to be at least as long as the string including the trailing
int. In C++, it has type