How to prevent console window from closing when starting a console application?

I am creating a simple console application under Windows XP and wondering if there is a way to open the console window after starting the application from the Windows prompt, without putting an endless loop at the end of main (), I want the application to behave as if it were launched from the start prompt after first entering cmd.

+6
console-application
source share
3 answers

I found an answer to a similar question that satisfies how to deal with this question. See What is the best practice for dealing with the issue of closing the console?

+1
source share

I think you will need a second application that calls the command line and tells it to run the console application.

You can even do this with a single application, which, when calling the parameterlessless, invites a prompt and itself with a parameter that disables this behavior.

+6
source share

ask the user to enter the input, stop the application flow, I think he was

string x = console.ReadLine(); 
+5
source share

All Articles