码迷,mamicode.com
首页 > 其他好文 > 详细

常用输入输出函数

时间:2015-05-20 12:55:57      阅读:120      评论:0      收藏:0      [点我收藏+]

标签:

输入输出函数是在stdio.h中进行声明的,所以首先必须引用  #include <stdio.h>

stdio   英 [stdi‘???]   美 [stdio]   标准输入输出(standard input/ouput)

  • printf

    1、printf(字符串)

printf("Hello, World!");

          2、printf(字符串,格式符参数)

printf("My age is %d\n", 26);//使用常量作参数

int age = 26;//也可以使用变量
printf("My age is %d", age);

//注意:左边字符串中格式符的个数 必须跟 右边格式符参数的个数一样;格式符的类型决定了格式符参数的类型,比如使用%d,说明对应的格式符参数必须是整型。

 

  • scanf

  • putchar

  • getchar

  • puts

  • gets

常用输入输出函数

标签:

原文地址:http://www.cnblogs.com/yaosuc/p/4516711.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!