QUOTE(Algorythm @ 25 May, 2007 - 11:59 AM)

>>This should work with a normal compiler,
Dev-C++ is a normal compiler.

>>but this program just opens up the box and immediately closes
That's because it's done. It printed the message and found nothing else to do, so the process that spawned the window terminates and the window goes bye-bye as well. To get around that and still run from the IDE, you can pause for input:
CODE
#include <iostream>
int main() {
std::cout<<"Hello World!\n";
std::cout<<"Press Enter to continue . . \n";
std::cin.get();
}
A cleaner way to do it is thus:
CODE
#include <iostream>
using namespace std;
int main () {
cout << "Hello, world!" << endl;
cout << "Press any key to continue..." << endl;
cin.get();
return 0;
}
Note the use of "using namespace std;" under the #include, it means you don't have to to put std:: in front of everything.