This repository has been archived on 2024-12-16. You can view files and clone it, but cannot push or open issues or pull requests.
CodeBlocksPortable/WATCOM/samples/cplbexam/ios/good.cpp

14 lines
273 B
C++
Raw Normal View History

#include <iostream.h>
#include <fstream.h>
void main( void ) {
fstream test ( "temp.txt", ios::in|ios::out );
if( !test.bad() ) {
test << "Hello my world!" << endl;
}
if( test.good() ) {
cout << "The iostate is clear!" << endl;
}
}