You can use the exit() function defined in stdlib.h .
1 2 3 4 5 6 7 8 9 10 11 12 13
#include<iostream>
//other includes.....
#include<stdlib>
usingnamespace std;
//passing to the main point
if(a=='Q'||a=='q')
{
cout<<"Quitting...."<<endl;
exit(0);
}
You have to specify the '0' in the exit() function by the way.