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>    //宽字符分类
相关推荐
wildlily84279 小时前
C++ Primer 第5版章节题 第十章
开发语言·c++
刘孬孬沉迷学习9 小时前
层与天线的区别
网络·学习·5g·信息与通信·mimo·预编码·层映射
冬夜戏雪9 小时前
【学习日记】【12.30】【14/60】
服务器·网络·学习
零雲10 小时前
java面试:@Resource和@Autowired的区别
java·开发语言·面试
liu****10 小时前
01_NumPy讲义
开发语言·python·numpy·python高级语法
一路往蓝-Anbo10 小时前
C语言从句柄到对象 (一) —— 全局变量的噩梦与“多实例”的救赎
c语言·开发语言·stm32·单片机·嵌入式硬件·物联网
松涛和鸣10 小时前
DAY42 SQLite3 : Dictionary Import and Data Query Implementation with C Language
linux·c语言·数据库·单片机·网络协议·sqlite
低频电磁之道10 小时前
C++中类的this指针
开发语言·c++
AI视觉网奇10 小时前
火星- ue数字人智能体 学习笔记
人工智能·笔记·学习
深蓝海拓10 小时前
PySide6从0开始学习的笔记(二十) qdarkstyle的深入应用
笔记·python·qt·学习·pyqt