MS-DOS Window in WindowsXP

S

Stefan Trendafilov

I start learning programming C++.
I compiled my first "HelloWorld" programm to HelloWorld.exe
When I start this executabel file it opens the MS-DOS Window and shows my text:
"Hallo world!".
After 1/10 second the programm end regularly.
Now my problem: the MS-DOS Window closes immediately, so I cant rally read the
text.
How can I force WindowsXP NOT to close on exit of the programm?
My HelloWorld.exe file is correct. When running from an editor (CrimsonEditor)
the MS-DOS Window doesnt close after end of programm.

Thank you for help
Stefan
www.trendafilov.de
Stefan
 
J

Jake

-----Original Message-----
I start learning programming C++.
I compiled my first "HelloWorld" programm to HelloWorld.exe
When I start this executabel file it opens the MS-DOS Window and shows my text:
"Hallo world!".
After 1/10 second the programm end regularly.
Now my problem: the MS-DOS Window closes immediately, so I cant rally read the
text.
How can I force WindowsXP NOT to close on exit of the programm?
My HelloWorld.exe file is correct. When running from an editor (CrimsonEditor)
the MS-DOS Window doesnt close after end of programm.

Thank you for help
Stefan
www.trendafilov.de
Stefan
HREF="http://www.trendafilov.de">www.trendafilov.de said:
when sending eMail substitute grp with 123
.
Open the MS-DOS first to the Command Prompt before
running C++ or any other program. Just type CMD in Run,
click OK and there you are.
 
L

Larry

Or put

printf("Press enter to close...");
getchar();

Just before the end of your program main :)

Larry
 
S

Stefan Trendafilov

Just type CMD in Run,
click OK and there you are.

this was not quite my question.
I start my executabel HelloWorld.exe by doubble-clicking it on my desktop.
This executable opens automaticly the MS-DOS window - thats fine.
But the problem comes, when the programm ends: the MS-DOS window closes
immdiately. I want to prevent this automatic closing of the window somehow.
regards
Stefan

Stefan
 
B

Bruce Chambers

Greetings --

Right-click on the shortcut, select Properties, and set it so that
the Window does not close upon completion.

Bruce Chambers

--
Help us help you:



You can have peace. Or you can have freedom. Don't ever count on
having both at once. -- RAH
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top