Heedle, I promise I wont needle you about your name..
Use a system("pause");
And basically after the program runs, it will ask you to press any key to
continue.
This only works on windows machines though, and some will suggest that you
program a response to a question in order to make your program portable...
From: Heedle Blambeedle [mailto:hee...@gm...]
Sent: Monday, February 02, 2009 5:29 PM
To: Dev...@li...
Subject: [Dev-C++] Compiler Ineffective
I made a program yesterday. I compiled it to an EXE file, but when I ran it,
the window didn't stay up and I couldn't see what it did.
This is the code of a basic program I made that doesn't stay open.
#include <iostream>
using namespace std;
int main ()
{
cout << "Hello World!";
return 0;
}
Do I need a pause in there?
Is there a piece of code at the beginning I don't know about?
If I am missing anything or if it is natural, please tell me.
Thank you!
Heedle
P.S. This is my first time on this list.
P.S.S. Don't make fun of my name please. I know it sucks and I don't need
you to rub it in.
P.S.S.S. Don't take offense at the previous sentence. It is just preliminary
in case anybody does make fun of it.
|