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

一、概念

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

二、作用

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

cpp 复制代码
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[,...]) //把格式化的数据写入某个字符串缓冲区

三、举例

cpp 复制代码
# include <stdio.h>
int main(){
	//使用printf函数来打印输出信息到屏幕 
	printf("hello c++");
	return 0;
}

四、常见头文件

cpp 复制代码
#include <assert.h>    //设定插入点
#include <ctype.h>     //字符处理
#include <errno.h>     //定义错误码
#include <float.h>     //浮点数处理
#include <fstream.h>    //文件输入/输出
#include <iomanip.h>    //参数化输入/输出
#include <iostream.h>   //数据流输入/输出
#include <limits.h>    //定义各种数据类型最值常量
#include <locale.h>    //定义本地化函数
#include <math.h>     //定义数学函数
#include <stdlib.h>    //定义杂项函数及内存分配函数
#include <string.h>    //字符串处理
#include <strstrea.h>   //基于数组的输入/输出
#include <time.h>     //定义关于时间的函数
#include <wchar.h>     //宽字符处理及输入/输出
#include <wctype.h>    //宽字符分类
相关推荐
我是陈泽14 分钟前
一行 Python 代码能实现什么丧心病狂的功能?圣诞树源代码
开发语言·python·程序员·编程·python教程·python学习·python教学
优雅的小武先生24 分钟前
QT中的按钮控件和comboBox控件和spinBox控件无法点击的bug
开发语言·qt·bug
邓校长的编程课堂30 分钟前
助力信息学奥赛-VisuAlgo:提升编程与算法学习的可视化工具
学习·算法
虽千万人 吾往矣31 分钟前
golang gorm
开发语言·数据库·后端·tcp/ip·golang
创作小达人33 分钟前
家政服务|基于springBoot的家政服务平台设计与实现(附项目源码+论文+数据库)
开发语言·python
郭二哈36 分钟前
C++——list
开发语言·c++·list
杨荧37 分钟前
【JAVA开源】基于Vue和SpringBoot的洗衣店订单管理系统
java·开发语言·vue.js·spring boot·spring cloud·开源
ZPC821043 分钟前
Python使用matplotlib绘制图形大全(曲线图、条形图、饼图等)
开发语言·python·matplotlib
missmisslulu1 小时前
电容笔值得买吗?2024精选盘点推荐五大惊艳平替电容笔!
学习·ios·电脑·平板
镜花照无眠1 小时前
Python爬虫使用实例-mdrama
开发语言·爬虫·python