Quits early using exit() function. - C++ Function

C++ examples for Function:Useful Function

Description

Quits early using exit() function.

Demo Code

#include <iostream>
using namespace std;
#include <stdlib.h>             // Required for exit().
int main()//w  w  w . java  2s.  c  om
{
   exit(0);               // Forces program to end here.
   cout << "C++ programming is fun.\n";
   cout << "I like learning C++ by example!\n";
   cout << "C++ is a powerful language that is " << "not difficult to learn.";
   return 0;
}

Related Tutorials