Whether I use feof() or a function with EOF, I can't get my program to really check for the actual end of a .exe file because apparently there are a bunch of EOF characters throughout the file. Is there a better way to find the real end of file? I finally got my copy program to work doing this:
Code:
while ( (bytes = fread(buf, sizeof (char), BUFSIZ, readfile) ) != NULL)
{
  fwrite(buf, sizeof (char), bytes, writefile);
}
and all my variables are defined correctly...

but it really doesn't check for end of file, it just prevents the program from writing extra characters to the end of the destination file... but without making my own function to find the real end of file, isn't there some built in function that will do the job?