The comment to this answer got me wondering. I\'ve always thought that C was a proper subset of C++, that is, any valid C code is valid C++ code by extension. Am I wrong a
A few more:
C allows recursive calls to main, C++ does not
char foo[3] = "abc"
is legal C, not C++
sizeof('A') == sizeof(int)
is true in C and false in C++
There are even more changes with C99
Edit: I found a post that lists the majority of the differences. http://c-faq.com/misc/cplusplus.nr.html
Summary of why C is not proper subset of C++:
void *
to any object/incomplete typestruct
s becoming scopedstruct
tags becoming typedef
sint
rulesmain
//
commentschar
and not int
etc.