Console window problems

solidus

Newcomer
Joined
Aug 28, 2003
Messages
2
I have a problem. When I used to write Win32 console applications in Visual C++ 6, when I had compiled the program, and ran the .exe, it would do what it is supposed to, and stay on the screen, with a PRESS ANY KEY TO CONTINUE dialog, when I was done using the app. I am now using Visual C++ .NET, and still writing those same console apps. However, now, instead of remaining on the screen waiting for me to close it, the window flashes, doing what it is supposed to ( I can just BARELY tell that it is working when I do I simple HELLO WORLD app ) but not staying long enough for me to do anything. I need to have that PRESS ANY KEY TO CONTINUE so I can continue to learn C++ and fiddle with its features without going into the graphical side, yet. So if anyone knows of a feature within the compiler that will enable this, or anything else that will help me, that would be a great help. I want something that will do it automatically rather then adding additional code to the simple prgms I am writing. And that, is my stupid question.
 
Other than starting your application from command prompt you cant do much to keep it there except wait for the user input and then exit. You can use this to achieve that:
Code:
Console::Read;
//or
Console::ReadLine;
 
Back
Top