Home > Electronics Tutorials > C Language Tutorial > stdio.h - File Functions - fread

C Language Programming Library Reference Guide

stdio.h - File Functions - fread


size_t fread(void *ptr, size_t size, size_t nmemb, FILE *stream); Reads data from the given stream into the array pointed to by ptr. It reads nmemb number of elements of size size. The total number of bytes read is (size*nmemb).

On success the number of elements read is returned. On error or end-of-file the total number of elements successfully read (which may be zero) is returned.

Note: To report broken links or to submit your projects, tutorials please email to Webmaster