According to my memory, the following code fragment should compile in C ++, but not in C. The only problem is how to check it? It is compiled with g ++ as well as gcc. I assume that g ++ is the C ++ compiler and gcc is the C compiler. I tried this with mingw on Windows. I'm right? if not, then how to compile it using the C compiler.
int main() {
const int i = 1;
const int j = 2;
const int k = 3;
int array[i + j + k];
return 0;
}
source
share