C fputc()

The fputc() function is used to write the character ch to the specified stream at the current file position and then advances the file position indicator.

fputc() Syntax

int fputc(int ch, FILE *stream);

The value returned by the fputc() function is the value of the character written. In case if an error occurs then EOF is returned.

fputc() Example

Following function writes the contents of a string to the specified stream:

void write_string(char *str, FILE *fp)
			fputc(*str++, fp);

C Online Test

« Previous Function Next Function »

Like/Share Us on Facebook 😋