hi,
im trying to keep the file but edit a offset so i use ios::app to get the file, now i try to use a_file.seek to get the offset and write with put only it puts it to the end of the file and not to the given offset and in ascII can some1 help me with this? my code is
Code:
#include <cstdlib>
#include <iostream>
#include <fstream>
#include <ostream>

using namespace std;

int main(int argc, char *argv[])
{
    char blah = 0x2;
    ofstream a_file ( "c:\\test.txt ", ios::app);
    if ( !a_file.is_open() ) {
         cout<<"error opening file.";
    }
    else {
         cout<<"file opened";
             a_file.seekp(0x2);
             a_file.put(74);
             a_file.flush();
             a_file.close();
    }
    system("PAUSE");
    return EXIT_SUCCESS;
}
i use dev-c++ 4.9.9.1
edit: removed unused code