What is fputc() and fgetc() in C programming?

Mayanknegi
Jan 10, 2023

--

The fputc() function is used to write a single character into a file. It outputs a character to a stream.

Syntax:

int fputc(int c, FILE *stream)

The fgetc() function returns a single character from the file. It gets a character from the stream. It returns EOF at the end of the file.

Syntax:

int fgetc(FILE *stream)

Learn more about the fputc() and fgetc() functions in C programming

--

--