If I compile and run a simple program in c++ like this:
int main(){
int x;
cout << x << endl;
}
and I compile in Linux saying g++ myProgram.cc (or g++ -std=c++14), I obviously get the ./a.out executable which works fine and the automatically initialized value 0 prints.
But if I compile my code with g++14 myProgram.cc, I get an error saying that x is uninitialized.
Is g++14 some sort of different version? I'm confused on why this is happening, thanks!
No comments:
Post a Comment