#include <iostream> #include <fstream> #include <cstdlib> using namespace std; int main(int argc, char *argv[]) { fstream out("test.txt", ios::in | ios::out | ios::binary); if(!out) { cout << "Cannot open file."; return 1; } out.seekp(12, ios::beg); out.put('a'); out.close(); return 0; }