Monday, May 24, 2010

C++: what command to exit program?

In c++, what command can exit the program? i tried adding #include %26lt;stdlib.h%26gt; and void exit(); but nothing happened.

C++: what command to exit program?
Please try this instead:





exit(1) // Returns 1 to the operating system
Reply:Just to clarify, you use the exit(%26lt;number%26gt;) as the other answerers have said. The %26lt;number%26gt; represents whether or not the program encountered an error, and the error is the reason for exiting. If you use exit(0), there has been no error. Using exit(1) indicates there has been an error. Report It

Reply:Good point. Thx. Report It

Reply:exit(0);





It is used to exit ur c++ program


No comments:

Post a Comment