putc,putwc
stdio.h:インデックス への移動
ヘッダーファイル
stdio.h
カテゴリ
入出力ルーチン
プロトタイプ
int putc(int c, FILE *stream);
wint_t putwc(wint_t c, FILE *stream);
説明
文字をストリームに出力します。
putc は,stream で指定されたストリームに文字 c を出力するマクロです。
戻り値
成功した場合,putc は,出力された文字 c を返します。
エラーが発生した場合は,EOF を返します。
例
#include <stdio.h>
int main(void)
{
char msg[] = "Hello world\n";
int i = 0;
while (msg[i])
putc(msg[i++], stdout);
return 0;
}
移植性
POSIX | Win32 | ANSI C | ANSI C++ | |
---|---|---|---|---|
putc |
+ |
+ |
+ |
+ |
putwc |
+ |
+ |
+ |