printf函数的作用
2015-10-18 14:42
330 查看
刷到一道题, 要求说出printf函数的作用. 学到了很小的知识点.
// testvc6.cpp : Defines the entry point for the console application. // #include "stdafx.h" void fnTest(); int main(int argc, char* argv[]) { fnTest(); getchar(); return 0; } void fnTest() { /// int printf( const char *format [, argument]... ); /// Descript /// Print formatted output to the standard output stream. /// 将格式化后的输出打印到标准输出流, /// 大家都知道这个函数是打印, 重点是打印到标准输出流,而不是只能打印到控制台 /// Return Value /// Each of these functions returns the number of characters printed, or a negative value if an error occurs. /// 向标准输出流打印了多少个字符, 假设是负值, 说明发生了错误 /// 这个返回值在实际工作中从来没用过, 也许做统计的时候会用到 /// Parameters /// format /// Format control /// 格式化控制字符串 /// argument /// Optional arguments /// 可选参数 printf("hello\r\n"); /** 标准C函数库stdio.h里定义的printf函数的作用是(将格式化的输出到标准输出流), 其返回值是(int)类型, 参数是(变长参数)类型 */ }
相关文章推荐
- 关于smtp和pop3的端口
- 第六周
- poj 2891 Strange Way to Express Integers 【CRT】
- 使用Matlab进行图像的读写、显示和缩放(最近临插值和双线性内插值法)
- Java 异常
- Java内存管理原理及内存区域详解
- rpm&yum命令详解 & 区别解析
- windbg符号加载
- 首尾字符匹配算法
- php定时运行任务(windows7)
- Android 实现子View的状态跟随父容器的状态
- Java TreeMap 源码解析
- MySQL分片高可用集群之Fabric部署使用
- 安装xv6笔记
- valgrind 检查内存泄漏
- MediaWIKI-install
- Ubuntu下eclipse 的安装
- Latex日常学习·一
- C语言——文件
- 集合类操作优化经验总结