• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Stupid Question but stumped.


Heineken Man

Ok I know this is a stupid question but I am not sure how to correct this. Ok I am reading a book on "C" and it starts with some simple codes that open up a dos window and display some text. Well the question is how the hell do I keep the dos window open. As far as I can tell all my scripts work but it flashes so quick that I can hardly get a glance. It is begining to annoy me. Anyone know how to stop dos from closing after it runs the script?

Thanks for all that reply,
Heineken Man


Try to read a value from i/o at th end of your code ( getch(), scanf(...) )....read MSDN for more information about these funcion.


try this(works in java, which is much the same)

make sure u initialized the input stream thingy(IStream in java)

then add to the end before closing the brackets 'Input.pause();'

that will leave the window open until u hit return

or put in while(true){}

which will leave the window open until it is closed manually


I'm sorry Hal...
Political User
you need to run the programs from a dos window not from "run" or the built in run

i.e go to start->run and type cmd

then change to your directory and run the program

I will look into keeping a command window open (it is a windows thing not your program)

Members online

No members online now.

Latest posts

Latest profile posts

Perris Calderon wrote on Electronic Punk's profile.
Ep, glad to see you come back and tidy up...did want to ask a one day favor, I want to enhance my resume , was hoping you could make me administrator for a day, if so, take me right off since I won't be here to do anything, and don't know the slightest about the board, but it would be nice putting "served administrator osnn", if can do, THANKS

Been running around Quora lately, luv it there https://tinyurl.com/ycpxl
Electronic Punk wrote on Perris Calderon's profile.
All good still mate?
Hello, is there anybody in there? Just nod if you can hear me ...
What a long strange trip it's been. =)

Forum statistics

Latest member