#include #include using namespace std; int main ( int argc, char* argv[] ) { char outbuffer[8]; ofstream out("passwd.dat"); //random input from random file int where=0; cout<< "input 0 or 8: "; cin >>where; while(where==0 or where==8) { cout << where <<"? " ; cin >>outbuffer; out.seekp(where, ios::beg); out.write(outbuffer, sizeof(outbuffer)); cout << out.tellp() << endl; cout<< "input 0 or 8: "; cin >>where; } out.close(); return 0; }