By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,709 Members | 2,155 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,709 IT Pros & Developers. It's quick & easy.

console window closing upon opening

P: n/a
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 of Germany
Nov 17 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
"Alvo von Cossel I" <Al************@discussions.microsoft.com> wrote in
message news:34**********************************@microsof t.com...
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
Nov 17 '05 #2

P: n/a

"Alvo von Cossel I" <Al************@discussions.microsoft.com> schrieb im
Newsbeitrag news:34**********************************@microsof t.com...
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 of Germany


Try

"Console.ReadLine ( ) ;"

to make the console window stay opened until a key is being pressed.
Best Regards, Sebastian
Nov 17 '05 #3

P: n/a
Use getch() if this is a native C++ app.

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

--
Regards,
Nish [VC++ MVP]
http://www.voidnish.com
http://blog.voidnish.com
"Alvo von Cossel I" <Al************@discussions.microsoft.com> wrote in
message news:34**********************************@microsof t.com...
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 of Germany

Nov 17 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.