nCheck if file has been successfully opened
nIf ( !MyInFile ) {
n cout
<< “ Can not open the file !” << endl;
n exit
(1);
n }
nNote:
nexit( ) function is a request to the operating system to
end program execution immediately.
nexit( ) function requires inclusion of the stdlib.h header file
nexit( )’s single integer argument is passed directly to
the operating system program action or
user inspection.