putc, putwc
Remonter à Stdio.h - Index
Header File
stdio.h
Category
Input/output Routines
Prototype
int putc(int c, FILE *stream);
wint_t putwc(wint_t c, FILE *stream);
Description
Outputs a character to a stream.
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.
Example
#include <stdio.h>
int main(void)
{
char msg[] = "Hello world\n";
int i = 0;
while (msg[i])
putc(msg[i++], stdout);
return 0;
}
Portability
POSIX | Win32 | ANSI C | ANSI C++ | |
---|---|---|---|---|
putc |
+ |
+ |
+ |
+ |
putwc |
+ |
+ |
+ |