1. 函数名: getc 功 能: 从流中取字符
用 法: int getc(FILE *stream); //read the next character from stream and return it as an unsigned char cast to a int ,or EOF on end of file or error.
注意: 此函数被ISO C声明为一个宏,所以在用时不能将其做为函数指针传(有一些编译器将其以函数形式也给另说)。它的原型如下
2.putc(将一指定字符写入文件中)
相关函数 fopen,fwrite,fscanf,fputc
表头文件 #include<stdio.h>
定义函数 int putc(int c,FILE * stream);
函数说明 putc()会将参数c转为unsigned char后写入参数stream指定的文件中。虽然putc()与fputc()作用相同,但putc()为宏定义,非真正的函数调用。
返回值 putc()会返回写入成功的字符,即参数c。若返回EOF则代表写入失败。