February 19th, 2003, 09:49 PM
Programming C Question
This is the only part of the forum where I thought my question would fit in. I am new to programming in C and c++. Everytime I go to run my programs in windows xp they open and close out really fast. The only way I could stop that was by adding a pause in there and adding a pause to every one of my programs gets really tedious (at least to me it does) Is there any command in ms-dos that could keep open my program without windows xp closing it so fast. Its just frustrating not being able to see the output of the program.
Thanks for your help
February 19th, 2003, 09:55 PM
bacause, there is no pause at the end of your program...
either stick an inkey type statement at the end, or you can set windows to not close DOS program's after their done...
You can use getc() or getchar() from stdio.h
You can also have a delay instead Sleep(milliseconds);
You can also run the exe from the prompt and it will not close the window
yeah, I\'m gonna need that by friday...
February 19th, 2003, 10:33 PM
TampaBay give a great suggestion you can also open a console window (start-run-cmd) and go to the directory where the program is (visual studio default path is C:\Program Files\Microsoft Visual Studio\MyProjects\<projectName>\debug) and run the executable.
If you spend more on coffee than on IT security, you will be hacked. What\'s more, you deserve to be hacked.
-- former White House cybersecurity adviser Richard Clarke
February 20th, 2003, 03:58 AM
thanks for your help guys :-)