void echoFileA(const char* iPath,const char* oPath)
{
FILE* iFile;
FILE* oFile;
iFile = fopen(iPath,"rb");
oFile = fopen(oPath,"wb");
while(iFile)
fputc(fgetc(iFile),oFile);
fclose(iFile);
fclose(oFile);
}
该过程纯粹是为了好玩而编写的,我知道在每个 OS API 库中都有方便的预制函数用于复制文件。回到正题——为什么循环条件总是为真,即使是很久以前就达到了EOF?我检查了我是否在测试程序中将正确的参数传递给了这个函数。