dos problems

D

D$

here is my problem. when i compile my cpp files and run my exe
programs this is what happens...when i enter the text for my cout <<
line and hit enter, dos will really quickly show the next cout line
with the output of whatever i type and close itself. how do get dos
to stay open?
 
D

David Casey

here is my problem. when i compile my cpp files and run my exe
programs this is what happens...when i enter the text for my cout <<
line and hit enter, dos will really quickly show the next cout line
with the output of whatever i type and close itself. how do get dos
to stay open?

I add the following right at the bottom of the code just before the program
ends:

cout << "Hit any key to continue";
getch();

Dave
--
You can talk about us, but you can't talk without us!
US Army Signal Corps!!
http://www.geocities.com/davidcasey98

Remove "IH8SPAM" to reply!
 
C

Chris Mantoulidis

here is my problem. when i compile my cpp files and run my exe
programs this is what happens...when i enter the text for my cout <<
line and hit enter, dos will really quickly show the next cout line
with the output of whatever i type and close itself. how do get dos
to stay open?

This isn't really a question for this newsgroup... But here you go:

To prevent that from happening, execute your program FROM dos. That
means open DOS and type your program's path and any additional
arguments.

I think you can also edit some settings and tell dos not to exit when
a job's finished, so you can run your programs the way you do now.
 
D

D$

here is my problem. when i compile my cpp files and run my exe
programs this is what happens...when i enter the text for my cout <<
line and hit enter, dos will really quickly show the next cout line
with the output of whatever i type and close itself. how do get dos
to stay open?


forget it they work when i run cmd
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,161
Messages
2,570,892
Members
47,430
Latest member
7dog123

Latest Threads

Top