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);
}
The procedure was written purely for fun, I know that there are covenient , premade functions for copying files in the every OS API libriaries. Back to the topic- why the loop condition is always true, even if the EOF was reached a long time ago?
I’ve checked that I’ve passed the correct parameters to this function in the testing program.
The body of your loop …
… does nothing to change the condition of the loop, so it will run forever.
Instead try something like …
The loop will end once you hit the end of the input file.