int main(int argc, char **argv)
{
FILE *fe, *fs;
unsigned char buffer[2048];
int bytesreader;
fe = fopen(argv[1], "rb");
fs = fopen(argv[2], "wb");
while((bytesreader = fread(buffer, 1, 2048, fe)))
fwrite(buffer, 1, bytesreader, fs);
fclose(fe);
fclose(fs);
return 0;
}
而我的错误是......
*** glibc detected *** ./doc2: double free or corruption (top): 0x096b7008 ***
对不起,现在是正确的,但我不明白。我的失败在哪里?