One from top of my head - C++ does not support default int.
dark_charlie
2010-09-23 09:37:40
The elephant in the room: the following is valid C but not valid C++.
int typename = 1;
Substitute your favorite C++ reserved word.
C++ also does not support variable-length arrays, where:
int array[n];
is valid in C, but not C++. A C++ version of the above would be:
int *array = new int[n];
...
delete [] array;
Simple example, consider this declaration:
int f();
This is valid C, but invalid C++: f(3, 2, -5, "wtf");
Explanation: in C, int f()
is really int f(...)
. Declare as int f(void)
if you don't want f
to take parameters.
There is a special wiki entry that summarizes a lot of issues.