fputc()函数fputc
语法:
1 2 |
?? #include <stdio.h> ?? int fputc( int ch, FILE *stream ); |
函数fputc()把给出的字符ch写到给出的输出流. 返回值是字符, 发生错误时返回值是EOF.
1 2 3 4 5 6 7 8 9 10 11 12 13 |
#include <stdio.h> #include <string.h> int main(void) { char msg[]="Hello world"; int i=0; while(msg[i]&&(i<strlen(msg))) { fputc(msg[i],stdout); i++; } return 0; } |