原型
会从参数stream的文件流中读取字符串,再根据参数format字符串来转换并格式化数据。
1 2 3 4 5 6 7 8 9
|
int fscanf(FILE * stream ,const char *format,....);
|
使用参考
1 2 3 4 5 6 7 8 9 10 11 12
| #include <stdio.h>
int main() { int i; unsigned int j; char s[5]; fscanf(stdin, "%d %x %5[a-z]s", &i, &j, s); printf("参数打印i:%d j:%d s:%s\n", i, j, s);
return 0; }
|