这个函数参数哪里错了?
#include <iostream>
#include <fstream>
using namespace std;
int MY_WEAPON = 2257;
void main() {
fstream fs("save000.dat", ios::in | ios::out | ios::binary);
if(!fs) {
cerr << "cannot open file\n";
exit(1);
}
// cout << "press 'L' to list commands" << endl;
char buffer[] = "AAACCC";
modify(fs, MY_WEAPON, buffer);
fs.close();
}
void modify(fstream fs, int offset, char buf[]) {
fs.seekp(offset, ios::beg);
fs.write(buf, strlen(buf));
}
错误提示好像说modify的参数传递有问题,问题在哪儿呢?