putc() - I/O Function
How is "putc()" used in C++?
is an I/O function which is equivalent to fputc(). putc is used to write the character to the specified stream at the current file position indicator, then increases file position indicator. If no error occurs the same character that has been written is returned otherwise EOF is returned with the error indicator being set.
int putc ( int character, FILE * stream );
FILE * str= fopen("text.txt","wt");
for (c = 'A' ; c <= 'C' ; c++)
putc (c , str);
In the above example the "putc()" is used to write a character "ABC" to the specified stream into a text file.