Skip to main content
GameDev.net gamedev.net
🔒 Locked

Not Excecuting

Started by GhostDJR Oct 24, 2005 at 9:52 PM 3 replies 650+ views
Original Post
GhostDJR
GhostDJR
Not really new to C++ but I haven't done it in A LONG time. The thing is when I compile and run it only pops up for a split second instead od actually saying hello. I'm using Dev-C++ from bloodshed, possibly not the best compiler but it's free and that's basically my budget. Well thanks, any help is appreciated.
KulSeran
KulSeran
It probably is running, just not pausing.

add
system("pause");
or a
getch();
or a
char x; cin>>x;

to the end of the program to force it to pause for you.
Deranged
Deranged
Quote:
Original post by KulSeran
It probably is running, just not pausing.

add
system("pause");
or a
getch();
or a
char x; cin>>x;

to the end of the program to force it to pause for you.


or cin.get(); which is pretty much the latter of your choices.
GhostDJR
GhostDJR
This is what I have right now. I tried putting those things in different parts of the code.
#include
using namespace std; //introduces namespace std
int main( void )
{
cout << "Hello World!!!" ;
system("pause");
return 0;

}
Rewrite it for me please and show me my mistakes.
Conner McCloud
Conner McCloud
You should be able to run it from the command line. I'm not sure where DevCPP sticks things by default, but it should be in your project folder somewhere. Run it from the command line, and see if it says hi.

CM

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.