ProAnswers.org

Is C++ backward compatible with ANSI-C?

c

Almost. C++ is as close as possible to compatible with ANSI-C but no closer.
In practice, the major difference is that C++ requires prototypes, and that
f()' declares a function that takes no parameters, while ANSI-C rules state thatf()’ declares a function that takes any number of parameters of any type.
There are some very subtle differences as well, like the sizeof a char literal
being equal to the sizeof a char (in ANSI-C, sizeof(‘x’) is the sizeof an int).
Structure `tags’ are in the same namespace as other names in C++, but C++ has
some warts to take care of backward compatibility here.