C语言初学1:详解#include <stdio.h>

一、概念

#include 称为编译预处理命令,它在告诉C编译器在编译时包含stdio.h文件,如果在代码中,调用了这个头文件中的函数或者宏定义,则需引用该头文件。

二、作用

stdio.h是c语言中的标准输入输出的头文件,该文件中定义了c语言编译环境下的可以调用的标准函数,部分标准函数如下:

int getchar() //从标准输入获取一个字符
int putchar() //将一个字符输出到标准输出
int scanf(char*fromat[,argument...]) //从标准输入设备读入格式化后的数据
int printf(char*fromat[,argument...]) //将格式化的数据打印到标准输出
char gets(char*string) //从标准输入获取一个字符串
int puts(char*string) // 将一个字符串输出到标准输出
int sprintf(char*string,char*format[,...]) //把格式化的数据写入某个字符串缓冲区

三、举例

# include 
int main(){
	//使用printf函数来打印输出信息到屏幕 
	printf("hello c++");
	return 0;
}

四、常见头文件

#include     //设定插入点
#include      //字符处理
#include      //定义错误码
#include      //浮点数处理
#include     //文件输入/输出
#include     //参数化输入/输出
#include    //数据流输入/输出
#include     //定义各种数据类型最值常量
#include     //定义本地化函数
#include      //定义数学函数
#include     //定义杂项函数及内存分配函数
#include     //字符串处理
#include    //基于数组的输入/输出
#include      //定义关于时间的函数
#include      //宽字符处理及输入/输出
#include     //宽字符分类

你可能感兴趣的:(c语言,学习,开发语言)