printf函数的作用

来源:互联网 发布:nero软件 编辑:程序博客网 时间:2024/05/18 01:20

刷到一道题, 要求说出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)类型, 参数是(变长参数)类型*/}


0 0
原创粉丝点击