#include #include using namespace std; int main() { ofstream outputFile ; ifstream inputFile ; int number ; string word ; int x1 = 100 ; outputFile.open("data7.txt"); cout << "Now writing data to the file.\n"; outputFile.write( (const char*)&x1, sizeof( x1 ) ) ; x1=200 ; outputFile.write( (const char*)&x1, sizeof( x1 ) ) ; outputFile.close() ; inputFile.open( "data7.txt", ::std::ios::binary); while ( inputFile ) { int x2=0 ; inputFile.read((char*) &x2, sizeof(x2 ) ) ; if (inputFile) { ::std::cout << "Read a " << x2 << "\n"; } } //while return 0; } //main