|
|
|||||
|
Get the Ebook
C Tutorial
Source Code
Function Reference
|
exit()Prototype: void exit(int ExitCode);Header File: stdlib.h (C) or cstdlib (C++) Explanation: Exit ends the program. The ExitCode is returned to the operating system, similar to returning a value to int main. Example:
//Program exits itself
//Note that the example would terminate anyway
#include <cstdlib>
#include <iostream>
using namespace std;
int main()
{
cout<<"Program will exit";
exit(1); // Returns 1 to the operating system
cout<<"Never executed";
}
Other Functions
Want to become a C++ programmer? The Cprogramming.com ebook, Jumping into C++, will walk you through it, step-by-step. Get Jumping into C++ today!
Popular pages
Custom Search
|
||||