includefstreamh includestdlibh needed for exit

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: .h> // needed for exit() int main() { in_file.open("test.dat"); if(in_file.fail())//check for a successful open { cout<<"file not opened"<<endl; exit(1); } cout<<The file has been successfully opened<<endl; return 0; } Example 1...
View Full Document

Ask a homework question - tutors are online