#include<stdio.h> stdio 就是指 “standard input & output"(标准输入输出),例如c语言中的 printf("%d",i); scanf("%d",&i);等函数。 #include<string.h> 在使用到字符数组时需要使用. #include <stdlib.h> stdlib 头文件即standard library标准库头文件。stdlib.h里面定义了五种类型、一些宏和通用工具函数。 类型例如size_t、wchar_t、div_t、ldiv_t和lldiv_t; 宏例如EXIT_FAILURE、EXIT_SUCCESS、RAND_MAX和MB_CUR_MAX等等; 常用的函数如malloc()、calloc()、realloc()、free()、system()、atoi()、atol()、rand()、srand()、exit()等等。 #include <errno.h> errno.h 是C语言C标准函式库里的标头档,定义了通过错误码来回报错误资讯的宏。 #include <sys/types.h> sys/types.h,在应用程序源文件中包含 <sys/types.h> 以访问 _LP64 和 _ILP32 的定义。所有这些类型在 ILP32 编译环境中保持为 32 位值,并会在 LP64 编译环境中增长为 64 位值。如fd_set 文件描述集、off_t 用于文件大小和偏移量、pid_t 进程ID和进程组ID、size_t 反映内存中对象的大小(以字节为单位)、time_t 以秒为单位计时等。 #include <unistd.h> unistd.h 是 C 和 C++ 程序设计语言中提供对 POSIX 操作系统 API 的访问功能的头文件的名称。unistd.h 中所定义的接口通常都是大量针对系统调用的封装(英语:wrapper functions),如 fork、pipe 以及各种 I/O 原语(read、write、close 等等)。 #include <sys/stat.h> int chmod(const char *, mode_t); int fchmod(int, mode_t); int fstat(int, struct stat *); int lstat(const char *, struct stat *); int mkdir(const char *, mode_t); int mkfifo(const char *, mode_t); int mknod(const char *, mode_t, dev_t); int stat(const char *, struct stat *); mode_t umask(mode_t); #include <netinet/tcp.h> setsockopt() or getsockopt(). #include <fcntl.h> fcntl.h定义了很多宏和open,fcntl函数原型,打开文件的模式。 #include <sys/ioctl.h> ioctl()是I/O操作的杂货箱,很多事情都要依靠它来完成 #include <netdb.h> Unix和Linux特有的头文件,主要定义了与网络有关的结构、变量类型、宏、函数等。gethostbyname、gethostbyaddr头文件 #include <stdarg.h> stdarg.h是C语言中C标准函数库的头文件,stdarg是由standard(标准) arguments(参数)简化而来,主要目的为让函数能够接收可变参数。
转载请注明原文地址: https://www.6miu.com/read-56796.html