#include <stdio.h>size_t fread(void *buf, size_t size, size_t count, FILE *stream);

The fread( ) function reads count number of objects, each object being size bytes in length, from the stream pointed to by stream and stores them in the array pointed to by buf. The file position indicator is advanced by the number of characters read.

In C99, buf and stream are qualified by restrict.

The fread( ) function returns the number of items actually read. If fewer items are read than are requested in the call, either an error has occurred or the end of the file has been reached. You must use feof( ) or ferror( ) to determine what has taken place.

If the stream is opened for text operations, certain character translations, such as carriage return/linefeed sequences being transformed into newlines, may occur.

Related functions are fwrite( ), fopen( ), fscanf( ), fgetc( ), and getc( ).

C(s)C++ Programmer's Reference
C Programming on the IBM PC (C Programmers Reference Guide Series)
ISBN: 0673462897
EAN: 2147483647
Year: 2002
Pages: 539 © 2008-2017.
If you may any questions please contact us: