COM1100 -- Winter2000 -- Yuhong Yin
12
Steps in using Files – 3
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.