Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

how do you keep the window form closing when you run a win32 console application

0 views
Skip to first unread message

John

unread,
Dec 28, 2002, 12:37:29 PM12/28/02
to
Hi, i just got microsoft visual c++ standard, version 2002
and i am writing win32 console application programs. when
i run a program it brings up a new window to display the
output of the program. however, when it does this it
displays the output and closes the window so you never get
a chance to look at the output. does anybody know how to
fix this? if you do please e-mail me at jfo...@hotmail.com
thanks!

Thomas

unread,
Dec 28, 2002, 3:24:20 PM12/28/02
to
You can wait for user to enter something on the keyboard like this

char holder;
printf("Press Enter To Exit\n");
scanf ("%s", &holder);

Hope that helps
Thomas

"John" <jfo...@hotmail.com> wrote in message
news:035b01c2ae97$cb91f430$cef82ecf@TK2MSFTNGXA08...

Kenny-Z

unread,
Dec 29, 2002, 10:00:52 PM12/29/02
to

system("PAUSE");

sends the command "PAUSE" to the command interpreter, I believe, thus:

Press any key to continue . . .

kz

"John" <jfo...@hotmail.com> wrote in message
news:035b01c2ae97$cb91f430$cef82ecf@TK2MSFTNGXA08...

vipin

unread,
Dec 30, 2002, 1:20:31 AM12/30/02
to
put a getchar() at the end of your program.
vipin
>.
>
0 new messages