C vs. C++
C++ is almost a complete superset of ANSI standard C, but there
are differences. - In C++, these two function prototypes
int f();
and int f(void);
are
equivalent, note that void is optional. - In C++, all
functions must have a protype. Protoypes are optional in C.
- Only
in C, is a character constant automatically elevated to an integer.
- Only in C, may a global variable be declared more than once.
- Only in C, may the main() be invoked from within the program.
- Taking the address of a register variable is only allowed
in C++