Saturday, May 22, 2010

I am trying to debug a "Hello World" console application but as soon as the console pops up it goes away.why?

OS: Windows Vista (using mostly default settings)


Language/IDE: C#/Visual Studio Express Editions





I can see that it is printing hello world but the window only stays up for a fraction of a second. How can I change it so that it stays up until I close it?





THANKS!

I am trying to debug a "Hello World" console application but as soon as the console pops up it goes away.why?
It is absolutely fine, it's just that windows closes the console when it's done; if you opened up your own console and run it from the console it wouldn't close. To prevent this when running it graphically(by just clicking it), you usually would use a getchar thing or something or in c you would do a system("pause") on window.s
Reply:have it wait for a keypress to exit.





Not sure what it would be in c# but maybe getchar or something.


No comments:

Post a Comment