scanf/fscanf/sscanf、vscanf/vfscanf/vsscanf
2016-02-21 22:09
471 查看
scanf, fscanf, sscanf, vscanf, vsscanf, vfscanf - input format conversion
格式化输入#include <stdio.h> int scanf(const char *format, ...); int fscanf(FILE *stream, const char *format, ...); int sscanf(const char *str, const char *format, ...); //Return: number of input items assigned, // EOF if input error or end of file before any conversion
scanf用于标准输入
fscanf用于指定的流
sscanf用于指定的字符串
vscanf等
将scanf系列中的参数(…)换成了va_list
#include <stdarg.h> int vscanf(const char *format, va_list ap); int vsscanf(const char *str, const char *format, va_list ap); int vfscanf(FILE *stream, const char *format, va_list ap); //Return: number of input items assigned, // EOF if input error or end of file before any conversion
format:scanf指定的参数
转换规范中有三个可选的组件,显示在下面的括号中:There are three optional components to a conversion specification, shown in square brackets below:
%[∗][fldwidth][m][lenmodifier]convtype\%[*][fldwidth][m][lenmodifier]convtype
* The optional leading asterisk(*) is used to
suppress(压制)conversion. Input is converted as specified by the rest of the conversion specification, but the result is not stored in an argument.
fldwidthThe fldwidth component specifies the maximum field width in characters.
因为标准IO库的内容会在之后讲解C的教程中详细讲解,这里也不多讲,日后补充
相关文章推荐
- Android基本控件
- 大众点评订单分库分表实践
- 欢迎使用CSDN-markdown编辑器
- 第1章 Java语言概述与开发环境
- Android大图片裁剪终极解决方案(下:拍照截图)
- 数据结构(八)
- 基于Java设计和实现系统的自动化巡检
- CPU cache 与内存对齐
- LEETCODE 15 3Sum (JAVA题解)
- Android布局
- xcode7 编译cocos2dx 项目到真机上
- Hadoop2.7.2版本分布式集群搭建详细记录(2)
- 处理syn半连接DDOS攻击
- 线程之间的通信
- 打包图集工具
- linux 查看定时任务的日志
- Request的getParameter和getAttribute方法的区别
- Multiple comparisons problem
- 索引的创建和使用
- PHP2