putc
语法:#include <stdio.h> int putc( int ch, FILE *stream ); |
putc()函数把字符ch写到stream(流)中. 返回值是写入的字符, 发生错误时返回EOF. 例如:
char ch; FILE *input; input = fopen( "temp.cpp", "r" ); ch = getc( input ); while( ch != EOF ) { printf( "%c", ch ); ch = getc( input ); }
显示"temp.cpp"的内容到屏幕.