#include <iostream>
#include <fstream>
#include <stdlib.h>
using namespace std;
main(int argc, char *argv[])
{
if(argc!=3) {
cout << "Usage: CHANGE <filename> <byte>\n";
return 1;
}
fstream out(argv[1], ios::in|ios::out);
if(!out) {
cout << "Cannot open file";
return 1;
}
out.seekp(atoi(argv[2]), ios::beg);
out.put('X');
out.close();
return 0;
}
|