fscanf函数的用法返回值fscanf函数的用法

大家好,今日小科来聊聊一篇关于fscanf函数的用法返回值,fscanf函数的用法的文章,现在让我们往下看看吧!
1、功 能: 从一个流中执行格式化输入,fscanf遇到空格和换行时结束,注意空格时也结束。
2、这与fgets有区别,fgets遇到空格不结束。
3、用 法: int fscanf(FILE *stream, char *format,[argument...]); 例一#include #include int main(void){int i;printf("Input an integer: ");/* read an integer from thestandard input stream */if (fscanf(stdin, "%d", &i))printf("The integer read was: %d",i);else{fprintf(stderr, "Error reading an integer from stdin.");exit(1);}return 0;}。
本文到此分享完毕,希望对大家有所帮助。
这篇好文章是转载于:知行礼动
- 版权申明: 本站部分内容来自互联网,仅供学习及演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,请提供相关证据及您的身份证明,我们将在收到邮件后48小时内删除。
- 本站站名: 知行礼动
- 本文地址: /news/detail/tanhchjbje