C语言头文件使用大全
- 格式:docx
- 大小:14.07 KB
- 文档页数:10
C语言中的头文件是包含在源代码文件中以便在编译时进行预处理的文件。
头文件通常包含函数、宏定义、结构体声明和其他重要的代码片段,以便在多个源文件中共享和重用。
一些常见的C语言头文件包括:
1. `<stdio.h>`:包含输入输出函数,如`printf` 和`scanf`。
2. `<stdlib.h>`:包含内存分配和释放函数,如`malloc` 和`free`,以及其他常用的函数。
3. `<string.h>`:包含字符串操作函数,如`strcpy`、`strlen` 和`strcmp`。
4. `<math.h>`:包含数学函数,如三角函数、指数函数等。
5. `<time.h>`:包含时间和日期相关的函数,如`time` 和`strftime`。
6. `<ctype.h>`:包含字符分类函数,如`isalpha` 和`isdigit`。
7. `<stdbool.h>`:定义了`bool` 类型和`true`、`false` 常量,用于布尔值。
8. `<stddef.h>`:定义了`NULL` 宏和一些与指针相关的类型。
这只是一小部分常用的C语言头文件,实际上还有很多其他头文件,每个头文件都提供了特定的功能。
通过包含适当的头文件,你可
以在C程序中使用相应的函数和定义。
C语言头文件大全
C语言是一门基础的编程语言,在编写程序时,头文件的作用非常重要。
头文件是C 语言程序中用来声明变量、函数和宏定义的文件,必须被包括在源程序中。
下面是C语言头文件的大全。
这些头文件是C语言编程中经常使用的,开发人员可以在编写程序时通过包含这些头文件来使用其中的函数和变量等。
需要特别注意的是,每个头文件的作用及其包含的函数和变量等都是不同的,开发人员在使用时必须要清楚头文件的作用和用途。
传统 C++#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 <stdio.h> //定义输入/输出函数#include <stdlib.h> //定义杂项函数及内存分配函数#include <string.h> //字符串处理#include <strstrea.h> //基于数组的输入/输出#include <time.h> //定义关于时间的函数#include <wchar.h> //宽字符处理及输入/输出#include <wctype.h> //宽字符分类////////////////////////////////////////////////////////////////////////// 标准 C++ (同上的不再注释)#include <algorithm> //STL 通用算法#include <bitset> //STL 位集容器#include <cctype>#include <cerrno>#include <clocale>#include <cmath>#include <complex> //复数类#include <cstdio>#include <cstdlib>#include <cstring>#include <ctime>#include <deque> //STL 双端队列容器#include <exception> //异常处理类#include <fstream>#include <functional> //STL 定义运算函数(代替运算符)#include <limits>#include <list> //STL 线性列表容器#include <map> //STL 映射容器#include <iomanip>#include <ios> //基本输入/输出支持#include <iosfwd> //输入/输出系统使用的前置声明#include <iostream>#include <istream> //基本输入流#include <ostream> //基本输出流#include <queue> //STL 队列容器#include <set> //STL 集合容器#include <sstream> //基于字符串的流#include <stack> //STL 堆栈容器#include <stdexcept> //标准异常类#include <streambuf> //底层输入/输出支持#include <string> //字符串类#include <utility> //STL 通用模板类#include <vector> //STL 动态数组容器#include <cwchar>#include <cwctype>using namespace std;////////////////////////////////////////////////////////////////////////// C99 增加#include <complex.h> //复数处理#include <fenv.h> //浮点环境#include <inttypes.h> //整数格式转换#include <stdbool.h> //布尔环境#include <stdint.h> //整型环境#include <tgmath.h> //通用类型数学宏。
标准C语言头文件ISO C 标准定义的头文件(24 项)类型实现常量尔类型和值通用类型数学宏分类和映射支持匹配类型<glob.h>? 路径名模式匹配类型库操作<grp.h>? 组文件<netdb.h>? 网络数据<assert.h> 验证程序断言<co mp lex.h>?支持复数算术运算<ctype.h>? 字符<errno.h>? 出错码<fenv.h>? 浮点环境<float.h>? 浮点常量<inttypes.h>? 整型格式转换<iso646.h> 替代关系操作符宏<limits.h>? <locale.h>? 局部类别<math.h>?数学常量<setjmp.h> 非局部goto <signal.h>? 信号<stdarg.h>? 可变参数表<stdbool.h>? 布<stddef.h>? 标准定义<stdint.h>? 整型<stdio.h>? 标准I/O <stdlib.h>? 实用程序库函数<string.h>? 字符串操作<tgmath.h>? <time.h>? 时间和日期<wchar.h>?宽字符支持vwct yp e.h>?宽字符POSIX标准定义的必须的头文件(26 项)<dirent.h>? 目录项<fcntl.h>? 文件控制<fnmatch.h>? 文件名<pwd.h> 口令文件<regex.h>? 正则表达式<tar.h>?tar 归档值<termios.h>? 终端 I/O<unistd.h>? 符号常量<utime.h>? 文件时间 <sys/msg.h>?消息队列<sys/resource.h> 资源操作<sys/sem.h>?信号量vwordex p.h>?字扩展类型 本地接口 <arpa/inet.h>?Internet 定义 <net/if.h>? 套接字<netinet/in.h> Internet 地址族 <netinet/tcp.h>? 传输控制协议 vsys/mma n.h>?内存管理声明 <sys/select.h>?selec t 状态 函数 <sys/socket.h>? 套接字接口 <sys/stat.h>? 文件<sys/times.h>? 进程时间 套接字定义 <sys/types.h>? 基本系统数据类型 <sys/un.h>?UNIX 域<sys/utsname.h> 系统名 <sys/wait.h>? 进程控制 POSIX 标准定义的XSI 扩展头文件(26项) <cpio.h> cpio 归档值 示结构 <dlfcn.h>? 动态链接 vfmtmsg.h>?消息显<ftw.h>? 文件树漫游 <iconv.h>? 代码集转换实用程序 <langinfo.h>? 语言信息常量 <libgen.h>? 模式匹配函数定义 作 <monetary.h>? 货币类型 <n dbm.h>?数据库操<nl_types.h>? 消息类别 <poll.h>? 轮询函数<search.h>? 搜索表<strings.h>? 字符串操作 上下文 <syslog.h>? 系统出错日志记录<ucontext.h>? 用户<ulimit.h>? 用户限制 <utm px.h>?用户帐户数据库 <sys/ipc.h> IPC<sys/shm.h>? 共享存储<sys/statvfs.h>? 文件系统信息<sys/time.h>? 时间类型<sys/timeb.h>? 附加的时间<sys/uio.h>? 矢量I/O 操作PO SIX标准定义的可选头文件(8 项)<aio.h>? 异步I/O vmqueue.h〉^ 息队列<pthread.h>? 线程vsched.h>?执行调度<semaphore.h> 信号量vspawn .h>?实时spawn 接口<stropts.h>?XSI STREAMS 接口<trace.h>? 时间跟踪标准C++语言头文件(54个其中16个用于构建STL,3个为附加非必须)valgorithm> STL 通用算法vbitset> STL位集容器<cassert>?用于在程序运行时执行断言vcctype>字符处理<cerrno> 错误码vcfloat>?用于测试浮点类型属性vciso646>?ISO646 变体字符集<climits>?测试整数类型属性<clocale> 本地化函<cmath> 数学函数<co mpl ex> 复数类<csetj mp>?执行非内部的goto语句<csignal>?信号<cstdarg>?访问参数数量变化的函数<cstddef>?用于定义实用的类型和宏<cstdio>输入/输出<cstdlib> 杂项函数及内存分配<cstri ng> 字符<ctime> 时间<cwchar>宽字符处理及输入/输出<cwctype> 宽字符分类vdeque> STL双端队列容器<exception> 异常处理类<fstream> 文件流<functional> STL 函数对象<iomanip>参数化输入/输出<ios> 基本输入/输出支持<iosfwd>输入/输出前置声明<iostream>数据流输入/输出<istream> 基本输入流viterator> 遍历序列的类<limits> 各种数据类型最值常量vlist> STL 线性列表容器vlocale> 国际化支持<ma p> STL映射容器<memory>专用内存分配器<new>基本内存分配和释放?<numeric>通用的数字操作<ostream> 基本输出流<queue> STL队列容器<set> STL集合容器<sstream> 基于字符串的流<stack> STL堆栈容器vstdexcept> 标准异常类<streambuf> iostream 的缓冲区类<stri ng> 字符串类<strstream>?非内存字符序列的流类<typeinfo> 运行时类型标识<utility> STL 通用模板类<valarray>?支持值数组的类和模版类<ve€tor>STL 动态数组容器标准C++附加的头文件(3个)非必须<hash map> <hash set> <slist>The Standard C++ library consists of 51 required headers.This implementation also includes three additional headers,<hash_map>,<hash_set>,and <slist>,not required by the C++ Standard, for a total of 54 headers.Of these 54 headers,16 constitutethe Standard Template Library, or STL.These are indicated below with the notation<algorithm> -- (STL) for defining numerous templates that implement useful algorithms<bitset> -- for defining a template class that administers sets of bits <complex> -- for defining a template class that supports complex arithmetic <deque> -- (STL) for defining a template class that implements a deque container <exception> -- for defining several functions that control exception handling <fstream> -- for defining several iostreams template classes that manipulate exteral files <functional> -- (STL) for defining several templates that help construct predicates forthe templates defined in <algorithm> and <numeric><hash_map> -- (STL) for defining template classes that implement hashed associative containersthat map keys to valuesassociativecontainers<iomanip> -- for declaring several iostreams manipulators that take anargument<ios> -- for defining the template class that serves as the base for manyiostreams classes<iosfwd> -- for declaring several iostreams template classes before theyarenecessarilydefined<iostream> -- for declaring the iostreams objects that manipulate the standard streams<istream> -- for defining the template class that performsextractions<iterator > -- (STL) for defining several templates that help define andmanipulateiterators<limits> -- for testing numeric type properties<list > -- (STL) for defining a template class that implements a doublylinked listcontainer<locale> -- for defining several classes and templates that controllocale-specific behavior, as in the iostreamsclassescontainersthatmap keys to values<memory> -- (STL) for defining several templates that allocate and freestorageforvariouscontainerclasses<new> -- for declaring several functions that allocate and freestorage<numeric> -- (STL) for defining several templates that implement usefulnumericfunctions<ostream> -- for defining the template class that performsinsertions<queue> -- (STL) for defining a template class that implements a queue container<set> -- (STL) for defining template classes that implementassociativecontainers<slist > -- (STL) for defining a template class that implements a singly linkedlistcontainer<sstream> -- for defining several iostreams template classes thatmanipulatestringcontainers<stack> -- (STL) for defining a template class that implements a stack container<stdexcept> -- for defining several classes useful for reporting exceptions<cfloat> -- for testing floating-point typeproperties<streambuf> -- for defining template classes that buffer iostreams operations <string> -- for defining a template class that implements a string container <strstream> -- for defining several iostreams classes that manipulate in-memory character sequences<typeinfo> -- for defining class type_info, the result of the typeid operator<utilit y> -- (STL) for defining several templates of general utility<valarray> -- for defining several classes and template classes that supportvalue-oriented arrays <vector> -- (STL) for defining a template class that implements a vector container 新的C 标准库 <cassert> -- for enforcing assertions when functions execute <cctype> -- for classifyingcharacters<cerrno>-- for testing error codes reported by library functions<ciso646> -- for programming in ISO 646 variant character sets<climits > -- for testing integer type properties<clocale> -- for adapting to different culturalconventions<cmath> -- for computing common mathematical functions<csetjmp> -- for executing nonlocal gotostatements<csignal> -- for controlling various exceptionalconditions<cstdarg> -- for accessing a varying number ofarguments<cstddef> -- for defining several useful types andmacros<cstdio> -- for performing input andoutput<cstdlib> -- for performing a variety ofoperations<cstring> -- for manipulating several kinds ofstrings<ctime> -- for converting between various time and dateformats<cwchar> -- for manipulating wide streams and several kinds of strings<cwctype> -- for classifying widecharacters旧的C标准库<assert.h> -- for enforcing assertions when functionsexecute<ctype.h> -- for classifyingcharacters<errno.h> -- for testing error codes reported by library functions<float.h > -- for testing floating-point type properties<iso646.h> -- for programming in ISO 646 variant character sets<limits.h > -- for testing integer type properties<locale.h> -- for adapting to different culturalconventions<math.h> -- for computing common mathematical functions<setjmp.h> -- for executing nonlocal gotostatements<signal.h> -- for controlling various exceptionalconditions<stdarg.h> -- for accessing a varying number ofarguments<stddef.h> -- for defining several useful types andmacros<stdio.h> -- for performing input andoutput<stdlib.h > -- for performing a variety of operations<string.h> -- for manipulating several kinds ofstrings<time.h> -- for converting between various time and dateformats<wchar.h> -- for manipulating wide streams and several kinds of strings<wctype.h> -- for classifying wide charactersFinally, in this implementation, the Standard C++ library also includes several headers for compatibility with traditional C++ libraries: <fstream.h> -- for defining several iostreams template classes that manipulate exteral files <iomanip.h> -- for declaring several iostreams manipulators that take an argument <iostream.h> -- for declaring the iostreams objects that manipulate the standard streams-- for declaring several functions that allocate and free storage-- for declaring several template classes that aid migration from olderversionsof the Standard Template Library<new.h> <stl.h>。
c语言头文件大全ctype.h字符处理函数: 本类别函数用于对单个字符进行处理,包括字符的类别测试和字符的大小写转换----------------------------------------字符测试是否字母和数字isalnum是否字母isalpha是否控制字符iscntrl是否数字isdigit是否可显示字符(除空格外) isgraph是否可显示字符(包括空格) isprint是否既不是空格,又不是字母和数字的可显示字符ispunct是否空格isspace是否大写字母isupper是否16进制数字(0-9,A-F)字符isxdigit字符大小写转换函数转换为大写字母toupper转换为小写字母tolower头文件local.h地区化: 本类别的函数用于处理不同国家的语言差异。
----------------------------------------地区控制地区设置setlocale数字格式约定查询国家的货币、日期、时间等的格式转换localeconv头文件math.h数学函数: 本分类给出了各种数学计算函数,必须提醒的是ANSIC标准中的数据格式并不符合IEEE754标准,一些C语言编译器却遵循IEEE754(例如frinklin C51)----------------------------------------反余弦acos反正弦asin反正切atan反正切2 atan2余弦cos正弦sin正切tan双曲余弦cosh双曲正弦sinh双曲正切tanh指数函数exp指数分解函数frexp乘积指数函数fdexp自然对数log以10为底的对数log10浮点数分解函数modf幂函数pow平方根函数sqrt求下限接近整数ceil绝对值fabs求上限接近整数floor求余数fmod头文件setjmp.h io.h本分类函数用于实现在不同底函数之间直接跳转代码。
----------------------------------------保存调用环境setjmp恢复调用环境longjmp头文件signal.h信号处理: 该分类函数用于处理那些在程序执行过程中发生例外的情况。
标准C语言头文件ISO C标准定义的头文件(24项)〈assert。
h〉验证程序断言<complex.h> 支持复数算术运算<ctype.h〉字符类型〈errno。
h〉出错码<fenv.h> 浮点环境〈float.h> 浮点常量<inttypes.h> 整型格式转换〈iso646。
h〉替代关系操作符宏〈limits.h> 实现常量<locale。
h〉局部类别<math。
h> 数学常量<setjmp.h> 非局部goto〈signal。
h〉信号〈stdarg。
h〉可变参数表〈stdbool.h> 布尔类型和值〈stddef。
h〉标准定义〈stdint。
h〉整型〈stdio.h> 标准I/O库〈stdlib。
h〉实用程序库函数<string.h〉字符串操作<tgmath.h〉通用类型数学宏〈time。
h〉时间和日期<wchar.h〉宽字符支持〈wctype。
h> 宽字符分类和映射支持POSIX标准定义的必须的头文件(26项)〈dirent。
h> 目录项<fcntl。
h〉文件控制<fnmatch.h> 文件名匹配类型〈glob。
h> 路径名模式匹配类型<grp。
h〉组文件<netdb.h> 网络数据库操作<pwd。
h> 口令文件<regex。
h〉正则表达式〈tar。
h> tar归档值<termios.h〉终端I/O 〈unistd.h> 符号常量〈utime.h> 文件时间〈wordexp。
h> 字扩展类型<arpa/inet。
h〉 Internet定义〈net/if.h〉套接字本地接口〈netinet/in。
h> Internet地址族 <netinet/tcp.h> 传输控制协议<sys/mman。
C语⾔⽂件操作的头⽂件计算机⽂件是以计算机硬盘为载体存储在计算机上的信息集合,是存储在某种长期储存设备上的⼀段数据流。
在C语⾔中⽤⼀个指针变量指向⼀个⽂件,这个指针称为⽂件指针。
通过⽂件指针就可对它所指的⽂件进⾏各种操作,C语⾔规定该⽂件指针类型为FILE型。
⽂件的信息有这个FILE型的结构体来进⾏定义。
FILE的结构体的定义如下例如我们定义⼀个⽂件指针:FILE *fp; fp指向某⼀个⽂件的⽂件信息区(是⼀个结构体变量),通过该⽂件信息区就能够访问该⽂件。
如下图所⽰:⽂件缓冲区:缓冲⽂件系统是指系统⾃动地在内存区为程序中每⼀个正在使⽤的⽂件开辟⼀个⽂件缓冲区。
从内存向磁盘输出数据必须先送到内存中的缓冲区,装满缓冲区后才⼀起送到磁盘中去。
⽂件的打开(fopen函数)函数调⽤:FILE *fp;fp = fopen(⽂件名,使⽤⽂件⽅式);typedef struct{short level; // 缓冲区“满”或“空”的程度unsigned flags; // ⽂件状态标志char fd; // ⽂件描述符unsigned char hold; // 如缓冲区⽆内容不读取字符short bsize; // 缓冲区的⼤⼩unsigned char *buffer; // 数据缓冲区的位置unsigned ar *curp; // 指针当前的指向unsigned istemp; // 临时⽂件指⽰器short token; // ⽤于有效性检查}FILE;注意:需要打开的⽂件名,也就是准备访问的⽂件的名字使⽤⽂件的⽅式(“读”还是“写”等);让哪⼀个指针变量指向被打开的⽂件。
⽂件使⽤⽅式 含 义-------------------------------------------------------------------------------------“r” (只读)为输⼊打开⼀个⽂本⽂件“w” (只写)为输出打开⼀个⽂本⽂件“a” (追加)向⽂本⽂件尾增加数据(以ascll码的形式追加)“rb” (只读)为输⼊打开⼀个⼆进制⽂件“wb” (只写)为输出打开⼀个⼆进制⽂件"ab“ (追加)向⼆进制⽂件尾增加数据(以⼆进制的形式追加)"r+“ (读写)为读/写打开⼀个⽂本⽂件"w+” (读写)为读/写建⽴⼀个新的⽂本⽂件"a+” (读写)为读/写打开⼀个⽂本⽂件"rb+“ (读写)为读/写打开⼀个⼆进制⽂件“wb+“ (读写)为读/写建⽴⼀个新的⼆进制⽂件“ab+” (读写)为读/写打开⼀个⼆进制⽂件-------------------------------------------------------------------------------------⼏点注意:凡⽤“r”打开⼀个⽂件时,该⽂件必须已经存在,且只能从该⽂件读出。
头文件ctype.h
函数列表<>
函数类别函数用途详细说明字符测试是否字母和数字isalnum 是否字母isalpha 是否控制字符iscntrl 是否数字isdigit 是否可显示字符(除空格外)isgraph 是否可显示字符(包括空格)isprint 是否既不是空格,又不是字母和数字的可显示字符是否空格isspace 是否大写字母isupper 是否16 进制数字(0-9,A-F )字符isxdigit 字符大小写转换函数转换为大写字母toupper 转换为小写字母tolower
ispunct 地区化
本类别的函数用于处理不同国家的语言差异
头文件local.h 函数列表
函数类别函数用途详细说明
地区控制地区设置setlocale
数字格式约定查询国家的货币、日期、时间等的格式转换localeconv
数学函数
本分类给出了各种数学计算函数,必须提醒的是ANSI C 标准中的
数据格式并不符合IEEE754 标准,一些C 语言编译器却遵循IEEE754(例如frinklin C51)
头文件math.h
函数列表
函数类别函数用途详细说明
错误条件处理定义域错误(函数的输入参数值不在规定的范围内)值域错误(函数的返回值不在规定的范围内)三角函数反余弦acos
反正弦asin 反正切atan
反正切2 atan2
余弦cos 正弦sin 正切tan 双曲函数双曲余弦cosh 双曲正弦sinh 双曲正切tanh 指数和对数指数函数exp 指数分解函数frexp 乘积指数函数fdexp 自然对数log 以10 为底的对数log10 浮点数分解函数modf 幂函数幂函数pow 平方根函数sqrt 整数截断,绝对值和求余数函数求下限接近整数绝对值fabs 求上限接近整数floor 求余数fmod
本分类函数用于实现在不同底函数之间直接跳转代码
文件setjmp.h io.h
函数列表
函数类别函数用途详细说明
保存调用环境setjmp
ceil
恢复调用环境longjmp
信号处理
该分类函数用于处理那些在程序执行过程中发生例外的情况。
头文件signal.h
函数列表
函数类别函数用途详细说明
指定信号处理函数signal
发送信号raise
可变参数处理
本类函数用于实现诸如printf,scanf 等参数数量可变底函数头文件stdarg.h 函数列表
函数类别函数用途详细说明可变参数访问宏可变参数开始宏
va_start 可变参数结束宏va_end 可变参数访问宏访问下一个可变参数宏va_arg 输入输出函数该分类用于处理包括文件、控制台等各种输入输出设备,各种函数以“流”的方式实现
头文件stdio.h
函数列表函数类别函数用途详细说明文件操作删除文件remove 修改文件名称rename 生成临时文件名称tmpfile 得到临时文件路径tmpnam 文件访问关闭文件fclose 刷新缓冲区fflush 打开文件fopen
将已存在的流指针和新文件连接 设置磁盘缓冲区 setbuf 设置磁盘缓冲区
setvbuf
格式化输出 vprintf 格式化输出 vsprintf 字符输入输出函数 输入一个字符 字符串输入 fgets 字符输出 fputc
字符串输出 fputs 字符输入(控制台) getc 字符输入(控制台) getchar 字符串输入(控制台) gets 字符输出 ( 控制台 ) putc 字符输出 ( 控制台 ) putchar 字符串输出 (控制台 ) puts
字符输出到流的头部 ungetc
直接输入输出 直接流读操作 fread
直接流写操作
fwrite 文件定位函数
得到文件位置 fgetpos 文件位置移动
fseek 文件位置设置
fsetpos 得到文件位置
ftell
文件位置复零位 remind
格式化输入与输出函数
格式输出 格式输入 fscanf
格式输出(控制台)
printf 格式输入(控制台) scanf 格式输出到缓冲区 sprintf
从缓冲区中按格式输入
sscanf 格式化输出 vfprintf
fprintf
freopen
fgetc
错误处理函数错误清除clearerr
文件结尾判断
feof
文件错误检测ferror
得到错误提示字符串perror
实用工具函数
本分类给出了一些函数无法按以上分类,但又是编程所必须要的。
头文件stdlib.h
函数列表
函数类别函数用途详细说明字符串转换函数字符串转换为整数atoi
字符串转换为长整数atol 字符串转换为浮点数strtod 字符串转换为长整数strtol 字符串转换为无符号长整型strtoul 伪随机序列产生函数产生随机数rand 设置随机函数的起动数值srand 存储管理函数分配存储器calloc 释放存储器free 存储器分配malloc 重新分配存储器realloc 环境通信中止程序abort 退出程序执行,并清除环境变量atexit 退出程序执行exit 读取环境参数getenv 程序挂起,临时执行一个其他程序system 搜索和排序工具二分查找(数据必须已排序)快速排序qsort 整数运算函数求绝对值abs div 得到除法运算底商和余数求长整形底绝对值labs 求长整形除法的商和余数ldiv
多字节字符函数得到多字节字符的字节数mblen 得到多字节字符的字节数mbtowc 多字节字符转换wctomb
多字节字符的字符串操作将多字节串转换为整数数组mbstowcs
将多字节串转换为字符数组mcstowbs
字符串处理本分类的函数用于对字符串进行合并、比
bsearch
较等操作
头文件string.h
函数列表函数类别函数用途详细说明字符串拷贝块拷贝(目的和源存储区不可重叠)memcpy 块拷贝(目的和源存储区可重叠)
memmove 串拷贝strcpy
按长度的串拷贝strncpy 将串拷贝到新建的位置处strdup 字符串连接函数串连接strcat 按长度连接字符串strncat 串比较函数块比较memcmp
字符串比较 strcmp 字符串比较(用于非英文字符) strcoll 按长度对字符串比较 strncmp
字符串转换 strxfrm 字符与字符串查找 字符查找 memchr 字符查找 strchr 在串中查找指定字符集的子集的第一次出现 字符串查找
strpbrk 在串中查找指定字符集的子集的第一次出现 在串中查找指定字符串的第一次出现 strstr 字符串分解 strtok
杂类函数 字符串设置 memset 错误字符串映射 strerror 求字符串长度 strlen 日期和时间函数 本类别给出时间和日期处理函数
头文件 time.h
函数列表
函数类别 函数用途 详细说明
时间操作函数 得到处理器时间 clock 得到时间差 difftime 设置时间 mktime 得到时间 time
时间转换函数 得到以 ASCII 码表示的时间 得到
字符串表示的时间 ctime 得到指定格式的时间 strftime
strcspn
strspn
asctime
函数库未来的发展方向本部分用于说明各类别函数库在将来如何发展
序号库类别头文件详细说明
1 错误处理errno.h
2 字符处理ctype.h
3 地区化local.h
4 数学函数math.h
5 信号处理signal.h
6 输入输出stdio.h
7 实用工具程序stdlib.h
8 字符串处理string.h。