954,499 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Windows goes away quickly

can someone help me, each time i send my friend a program he says tht the windows goes away once he enters something.
please help.

Mayank23
Light Poster
31 posts since Jan 2011
Reputation Points: 10
Solved Threads: 0
 

Is he running the code from the command line by typing it in, or by double-clicking it in some kind of file browser?

Moschops
Practically a Master Poster
620 posts since Sep 2008
Reputation Points: 258
Solved Threads: 117
 

i give him to him by a download link, its a .exe file then he double clicks on it and runs it, but then the program just goes away quickly.

Mayank23
Light Poster
31 posts since Jan 2011
Reputation Points: 10
Solved Threads: 0
 

If he runs it from a shell, any error message will remain on screen and then he can tell you the error and you can fix it.

Moschops
Practically a Master Poster
620 posts since Sep 2008
Reputation Points: 258
Solved Threads: 117
 

>>i give him to him by a download link, its a .exe file then he double clicks on it and runs it, but then the program just goes away quickly.

But what kind of program is it? If it's a console program, once the program exits, with or without an error, the window will be gone. You either need to change th console program so it pauses...

http://www.dreamincode.net/forums/topic/30581-holding-the-execution-window-open/

or he needs to run it from a console window (i.e. NOT by double-clicking it).

VernonDozier
Posting Expert
5,527 posts since Jan 2008
Reputation Points: 2,633
Solved Threads: 711
 

Lol... your code is most likely missing a system("pause");

Nandomo
Junior Poster
109 posts since Sep 2010
Reputation Points: 7
Solved Threads: 3
 

>> Lol... your code is most likely missing a system("pause");

This is generally frowned upon.

http://www.daniweb.com/forums/thread229044.html

But it will work. just be aware of the risks/drawbacks.

VernonDozier
Posting Expert
5,527 posts since Jan 2008
Reputation Points: 2,633
Solved Threads: 711
 

thanks alot for your help, the prblem is fixed

Mayank23
Light Poster
31 posts since Jan 2011
Reputation Points: 10
Solved Threads: 0
 

>> Lol... your code is most likely missing a system("pause");

This is generally frowned upon.

http://www.daniweb.com/forums/thread229044.html

But it will work. just be aware of the risks/drawbacks.

Lol... I know the risks, I use Sleep(); from the window.h header. In this case it will work just fine.

Nandomo
Junior Poster
109 posts since Sep 2010
Reputation Points: 7
Solved Threads: 3
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: