Quick question!
how do i stop my program from closing after it completes the code?
like wait for a key press then close, or something like that.
Thanks for helping a NUB! :D
If it''s a console program (ie: black window, white text... looks like DOS) you can just put a cin>> at the end. You could also use the Sleep() function to have it delay a few seconds.
Peon
isn''t there also a getline() function that you can use instead of the cin>> ?
--------------
In the immortal words of a MST3K ape: "MAYONAAAASE"
--------------
In the immortal words of a MST3K ape: "MAYONAAAASE"
--------------In the immortal words of a MST3K ape: "MAYONAAAASE"
getch(); (found in stdlib.h)
and system("pause"); (likewise in stdlib.h)
will also do the trick.
and system("pause"); (likewise in stdlib.h)
will also do the trick.
[twitter]warrenm[/twitter]
is there anything else i have to do in order to use getch(); ?
it gives me an error.
thanks..
P.S. system("pause"); works.
[edited by - virus3355 on January 24, 2003 10:07:38 PM]
it gives me an error.
thanks..
P.S. system("pause"); works.
[edited by - virus3355 on January 24, 2003 10:07:38 PM]
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement