During the development of a simple example (I haven't programmed C++ for some time) I encountered a weird behaviour. Following hello world program crashes under Windows (Mingw):
#include <iostream>
int main () {
for (int idx = 0; idx < 5; idx++) {
std::cout << "Hello World" << std::endl;
}
return 0;
}
If I remove std::endl
the program does not crash though.
I use following commands to compile and execute the example, with Mingw32 (g++ 4.8.1) on a 64bit system and OS:
g++ example.cpp -o example.exe
example.exe
The error message is:
example.exe does not work any longer...
Is this a known issue or an obvious mistake of mine?