The fgetc() function returns a single character from an open file.
Parameter | Description |
---|---|
file | Required. Specifies the file to check |
Note: This function is slow and should not be used on large files. If you need to read one character at a time from a large file, use fgets() to read data one line at a time and then process the line one character at a time with fgetc().
The output of the code above will be:
Read file character by character:
The output of the code above will be: