Tag: 输出

而((c = getc(file))!= EOF)循环不会停止执行

我无法弄清楚为什么我的while循环不起作用。 代码在没有它的情况下正常工作……代码的目的是在bin文件中查找秘密消息。 所以我得到了代码来找到这些字母,但现在当我试图让它循环到文件的末尾时,它不起作用。 我是新来的。 我究竟做错了什么? main(){ FILE* message; int i, start; long int size; char keep[1]; message = fopen(“c:\\myFiles\\Message.dat”, “rb”); if(message == NULL){ printf(“There was a problem reading the file. \n”); exit(-1); } //the first 4 bytes contain an int that tells how many subsequent bytes you can throw away fread(&start, sizeof(int), 1, message); printf(“%i […]