Predefined macro
This macro reads the contents of a file into a buffer. You must define the identity of the file with either the fopen macro or the FOPEN command. You can also specify the file as the Standard I/O window.
Syntax:
unsigned long fread (buffer, count, size, fileid)
void *buffer;
unsigned count;
unsigned size;
int fileid;
where:
|
buffer |
Specifies the start of the area into which the data is read. |
|
count |
Specifies the number of elements. |
|
size |
Specifies the size of each element in bytes. |
|
fileid |
The ID number of the file containing the data to be read. This must be a user-defined fileid. |
Return value
|
unsigned long |
The size of the data that is read, and is the same as size * count. However, it returns the value –1 if an end-of-file mark (EOF) or an error is encountered. |
|
fileid |
The ID number of the file where the next byte is to be written. This must be a user-defined fileid. |
unsigned long
Rules
None.