在C语言中,头文件包含一组预定义的标准库函数。“ #include”预处理指令用于在程序中包含扩展名为“ .h”的头文件。
下表显示了一些C语言的头文件,
| 序号 | 头文件和描述 | 
|---|---|
| 1 | stdio.h 输入/输出功能 | 
| 2 | conio.h 控制台输入/输出功能 | 
| 3 | stdlib.h 通用实用程序功能 | 
| 4 | math.h 数学函数 | 
| 5 | string.h 字符串函数 | 
| 6 | ctype.h 字符处理功能 | 
| 7 | time.h 日期和时间功能 | 
| 8 | float.h 浮点类型的限制 | 
| 9 | limits.h 基本类型的大小 | 
| 10 | wctype.h 用于确定宽字符数据中包含的类型的函数。 | 
这是C语言标头文件的示例,
#include <stdio.h>
#include<stdlib.h>
#include<string.h>
#include<math.h>
int main() {
   char s1[20] = "53875";
   char s2[10] = "Hello";
   char s3[10] = "World";
   int res;
   res = pow(8, 4);
   printf("Using math.h, The value is : %d\n", res);
   long int a = atol(s1);
   printf("Using stdlib.h, the string to long int : %d\n", a);
   
   strcpy(s2, s3);
   printf("Using string.h, the strings s2 and s3 : %s\t%s\n", s2, s3 );
   return 0;
}输出结果
这是输出-
Using math.h, The value is : 4096 Using stdlib.h, the string to long int : 53875 Using string.h, the strings s2 and s3 : World World