#include <iostream.h> #include <fstream.h> #include <stdlib.h> 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; }