原型
用于将一指定字符转为unsigned char
后写入参数stream
对应的文件中。
1 2 3 4 5 6
|
int fputc(int c, FILE * stream);
|
使用参考
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
| #include <stdio.h>
int main() { FILE * fp; char a[26]="abcdefghijklmnopqrstuvwxyz"; int i;
fp = fopen("test2", "w"); for(i = 0; i < 26; ++i){ fputc(a[i], fp); }
fclose(fp); return 0; }
|