console window closing upon opening

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

hi,

i have a working console app. however, it closes as soon as it opens.

i know that it works because i can just about read it. how do i stop it from
closing straight after opening?
 
Alvo von Cossel I said:
i have a working console app. however, it closes as soon as it opens.

Open up a command prompt window, navigate to the directory in which your
program resides and type its name.

Alternatively, choose 'Start without Debugging' from the Debug menu in the
IDE.

Regards,
Will
 
Alvo von Cossel I said:
hi,

i have a working console app. however, it closes as soon as it opens.

i know that it works because i can just about read it. how do i stop it
from
closing straight after opening?

Try

"Console.ReadLine ( ) ;"

to make the console window stay opened until a key is being pressed.
Best Regards, Sebastian
 
Use getch() if this is a native C++ app.

Use Console::ReadKey(true) if this is a C++/CLI app.
 

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

Back
Top