fread Function in C Programming
问题 I have two questions about C's fread function: I have read that fread is used to read a binary file. However, when I read a binary file with fgets using read mode "r" and a text file with fread using "rb" mode, the results are the same as reading a text file with fgets and a binary file with fread . So, why are there different functions for reading binary and text files? I am using fread to read 10 bytes of a file in one call. How should I stop reading at the end of file – i.e. how is EOF