> C/C++
This is specifically about the C programming language. Can we not conflate it with a different language entirely, at least in this comment thread?
This is specifically about the C programming language. Can we not conflate it with a different language entirely, at least in this comment thread?
They do try and stay reasonably consistent so for example Long Long moved from C to C++. And C99 has reduced some other incompatibilities by incorporating C++ features such as // comments and mixed declarations and code.
Many C++ compilers actually are C/C++ compilers that decide what language to compile depending on command line flags and/or file name extension.
int* foo = malloc(sizeof(int));
Is invalid C++. int* foo = (int*)malloc(sizeof(int));
in C++ or the compiler gives a type error.