The fgetc() function read a single character from the stream and return their ASCII value. After reading the character, it advances the associated file position indicator for the stream. It takes only one argument file stream.
In this article, I will explain to you, how to read the character from the given file using fgetc in C programming with example. The fgetc function obtains that character as an unsigned char converted to an int.
In the below code, I am reading a file using the fgetc. The file “aticleworld.txt” contains a string “I love File handling.”.
Output:
need an explanation for this answer? contact us directly to get an explanation for this answer