what is the difference between fread() and fgets()?
fgets reads a single line of characters, but fread reads a block of unidentified objects. fgets uses '\n' as a delimiter, but fread doesn't inspect any of the objects so it relies on a limit of the number of objects. If you're using fread to read string data, the only two significant differences are:
"fgets" is essentially a simplified version of "fread".
"fgets" is good for (and should only be used for) reading character strings from an input stream, be it a file or the stdin device.
"fread" is suited for any data type, such as binary (hex) data. it gives you more rope to hang yourself with, so if you're just wanting to read ascii text, stick with "fgets"
printf("\n Can't open file for reading");
printf("\n The contents of the file is \n");
while((c = fgetc(fp1)) != EOF)