10

How to exit a program with an exit code in C#? In java it would be System.exit(int code);

1
  • Have a look here Commented Aug 20, 2010 at 8:51

1 Answer 1

14

Either:

Returning a value from Main is a little nicer than exiting the process in the middle of a method, but this is presumably the same advice that applies to Java, C or C++.

Sign up to request clarification or add additional context in comments.

1 Comment

FYI, the docs for the possible return values for Main - msdn.microsoft.com/en-us/library/0fwzzxz2.aspx

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.