C/Visual C++ and Excutable files
Expert: Narendra - 8/13/2004
QuestionI previousley has asked the following question:
I created a C file and combile it and link it.
Now when I want to run it (i.e, execute it ) from dos window or using run from the MS C++ window the output flash only once then the "dos" window close. I can put a "scanf" command at the end of the C programme which will hold the DOS window which containe the results. However I am sure there must another way.
I got the following answer:
Instead you can use getch(), which will go away when you hit ENTER (With scanf() you will have to type a character and then hit ENTER).
MY QUESTION IS HOW CAN THE DOS WINDOW STAY OPEN WERE THE OUTPUT IS PRINTED ON THE DOS WINDOW SIMILAR TO UNIX OR LINUX WINDOW. WITHOUT PUTTING EXTRA COMMANDS LIKE scanf() or getch().
AnswerIn Unix or Linux, you will execute the program at command prompt.
So, if you do the same in DOS or Windows, you can observer the same behaviout.
So, open the command prompt by typing "cmd" or "Command" in the Run option of Start Menu.
Goto the place where your program is stored and execute the exe.
-ssnkumar