putc
raw OCR
Outputs a character to a stream.
Defined in header <stdio.h>
Syntax
#include <stdio.h>
int putc(int c, FILE *stream);
Portability
| DOS | UNIX | Windows | ANSI C | C++ only |
|---|---|---|---|---|
| ■ | ■ | ■ | ■ |
Remarks
putc is a macro that outputs the character c to the stream given by stream.
Return value
On success, putc returns the character printed, c. On error, putc returns EOF.
See also
Example
#include <stdio.h>
int main (void)
{
char msg[ "Hello world\n";
int i = 0;
while (msg[i])
putc (msg[i++], stdout);
return 0;
Differences from modern implementations
Nothing recorded yet.
Modern references
These are search links, not yet checked by hand.
Stable link: /3.1/stdio.h/putc/
· short form /3.1/putc/