The putc macro writes the byte character (converted to an unsigned char) to the output specified by the file_ptr parameter. The byte is written at the position at which the file pointer is currently pointing (if defined) and advances the indicator appropriately. If the file cannot support positioning requests, or if the output stream was opened with append mode, the byte is appended to the output stream. Since putc is a macro, a file pointer argument with side effects (for example, putc (ch, *f++)) might be evaluated incorrectly. In such a case, use the fputc function instead. Compiling with the __UNIX_PUTC macro defined enables an optimization that uses a faster, inlined version of this function. See also putc_unlocked.