Syntax | #include <stdio.h> size_t fread(void *ptr, size_t size, size_t nitems, FILE *stream); | |
Description |
BS2000
Number of bytes to be read: n If n is greater than the current record length, only the current record will be read. If n is less than the current record length, only the first n bytes of the record will be read, and
| |
Return val. | Number of elements successfully read | |
upon successful completion. The return value is less than nitems only if a read error or end-of-file is encountered. | ||
| 0 | if size or nitems id equal to 0. The contents of the array pointed to by ptr and the state of the stream remain unchanged. errno is not set.if a read error occurs. The error indicator for the stream is set, and |
Errors | See | |
Notes |
The array to which ptr points must be large enough to hold the data elements read. To ensure that size specifies the correct number of bytes for a data element, the
BS2000 The following applies in the case of text files with SAM access mode and variable record The program environment determines whether | |
See also |
|