I'm brand new to C++, bought the book Sams teach yourself C++,ran the first code Hello World. The Dev-C++ said that it compiled successfully,but when I run it, the C:prompt window only opens for a spilt second & closes...I was wondering if Dev-C++ works with XP Pro...using version 4.01 Thanks for any info...
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I'm brand new to C++, bought the book Sams teach yourself C++,ran the first code Hello World. The Dev-C++ said that it compiled successfully,but when I run it, the C:prompt window only opens for a spilt second & closes...I was wondering if Dev-C++ works with XP Pro...using version 4.01 Thanks for any info...
Add the line...
system("PAUSE");
just before the return 0; in the main function
#include <iostream>
#include <cstdlib>//don't think you need this
using namespace std;
int main()
{
cout<<"RTF\n";
system("PAUSE");
return 0;
}
#include <iostream>
#include <stdlib.h>
using namespace std
int main()
{
system("ECHO Add text here && PAUSE > NUL");
return 0;
}