Archived

This topic is now archived and is closed to further replies.

How do you slow down a fast dos program?

This topic is 6111 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

When I run this very simple program it runs to fast, is there any way that i can put a delay to slow it down? Like I said it is a very simple program. After it displays the message "Enter your age" and he person does so, but after that you cant read the next line, so how can you slow it down. Im on a 667mhz computer. Coded in C++ #include int main() { int age; cout<<"Enter your Age:"; cin>>age; if (age<10) { cout<<"You are fairly young."; } else if (age==15) { cout<<"You are as old as me."; } else if (age>60) { cout<<"You are getting vary old."; } return 0; }

Share this post


Link to post
Share on other sites
Run it from the console.

In Win9x/ME do this: Start->Run, Type "command.com"
In WinNT/2K do this: Start->Run, Type "cmd.exe"

Now use "cd ___" to change directories, use "M:" to change drives. When you get to the correct directory type the name of the exe, without the ".exe" after it to run it. The console will stay open after the program ends, allowing you to see the output.

"Finger to spiritual emptiness underlying everything." -- How a C manual referred to a "pointer to void." --Things People Said
Resist Windows XP''s Invasive Production Activation Technology!
http://www.gdarchive.net/druidgames/

Share this post


Link to post
Share on other sites
If you don''t want to run it on a console, you can use a little trick : just cin>>stuff (or getchar()/getkey()/etc...) at the end of the prog. This way, the application will wait for an input and you will be able to read its answer.

Of course, this doesn''t look very professionnal but for small test progs that''s useful.

Share this post


Link to post
Share on other sites