#include #include #include main(int argc,char *argv[]){ ofstream out("test.txt"); if(!out) { cout << "Cannot open file"; return 1; } out.seekp(2,ios::beg); out.put('X'); out.close(); return 0;}