C语言头文件大全

合集下载

c语言头函数

c语言头函数

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程序员屈指可数的几种依靠之一。
有趣的是,你很难找到一项关于标准库函数的最标准的信息。对于每一个函数,都需要有一个(在极少数情况下需要两个)保证能将该函数的原型提供给你的头文件(在调用任何一个函数时,都应该包含其原型,见8.2)。有趣的是什么呢?这个头文件可能并不是真正包含该函数原型的文件,在有些(非常糟糕!)情况下,甚至由编译程序手册推荐的头文件都不一定正确。对于宏定义,typedef和全局变量,同样会发生这种情况。
fclose stdio. h
feof stdio.h
ferror stdio.h
fflush stdio. h
fgetc stdio.h
c标准库中还缺少很多函数,例如投有图形函数,甚至没有全屏幕文本操作函数,signal机制也相当弱(见12.10),并且根本没有对多任务或使用常规内存以外的内存提供支持。尽管C标准库存在上述缺陷,但它毕竟为所有的程序都提供了一套基本功能,不管这些程序是运行在多任务、多窗口的环境下,还是运行在简单的终端上,或者是运行在一台昂贵的烤面包机上。
fgetpos stdio. h
fgets
stdio.h
FILE stdio. h
FILENAME-MAX stdio. h
floor math. h
fmod math. h
fopen stdio. h
FOPEN_MAX stdio. h
fpos_t stdio. h
cos math. h
cosh math. h
ctime time. h

c语言的头文件大全

c语言的头文件大全
fclose stdio. h
feof stdio.h
ferror stdio.h
fflush stdio. h
fgetc stdio.h
C标准库中所缺的函数可以从其它途径获得,例如编译程序开发商和第三方的函数库都会提供一些函数,这些函数都是事实上的标准函数。然而,标准库中的函数已经为程序设计提供了一个非常坚实的基础
12.1. 为什么应该使用标准库函数而不要自己编写函数?
标准库函数有三点好处:准确性、高效性和可移植性。
fwrite stdio. h
getc stdio.h
getchar stdio. h
getenv stdlib. h
gets stdio.h
abort stdlib. h
abs stdlib. h
acos math. h
asctime time. h
asin math. h
islower ctype. h
isprint ctype. h
ispunct ctype. h
isspace ctype. h
isupper ctype. h
fmod math. h
fopen stdio. h
FOPEN_MAX stdio. h
fpos_t stdio. h
fpnntf stdio. h
因此,你不用去寻找真正定义一个函数的头文件并使用这个文件,而应该使用那个被假定为定义了该函数的头文件,这样做是肯定可行的。
有几个名字在多个头文件中被定义:NULL,size_t和wchar_t。如果你需要其中一个名字的定义,可以使用任意一个定义了该名字的头文件((stddef.h>是一个较好的选择,它不仅小,而且包含了常用的宏定义和类型定义)。

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语言头文件大全

C语言头文件大全

1 头文件ctype.h函数列表<>函数类别函数用途详细说明字符测试是否字母和数字isalnum是否字母isalpha是否控制字符iscntrl是否数字isdigit是否可显示字符(除空格外)isgraph是否可显示字符(包括空格)isprint是否既不是空格,又不是字母和数字的可显示字符ispunct是否空格isspace是否大写字母isupper是否16进制数字(0-9,A-F)字符isxdigit字符大小写转换函数转换为大写字母toupper转换为小写字母tolower地区化本类别的函数用于处理不同国家的语言差异。

2 头文件local.h函数列表函数类别函数用途详细说明地区控制地区设置setlocale数字格式约定查询国家的货币、日期、时间等的格式转换localeconv数学函数本分类给出了各种数学计算函数,必须提醒的是ANSI C标准中的数据格式并不符合IEEE754标准,一些C语言编译器却遵循IEEE754(例如frinklin C51) .3 头文件math.h函数列表函数类别函数用途详细说明错误条件处理定义域错误(函数的输入参数值不在规定的范围内)值域错误(函数的返回值不在规定的范围内)三角函数反余弦acos反正弦asin反正切atan反正切2 atan2余弦cos正弦sin正切tan双曲函数双曲余弦cosh双曲正弦sinh双曲正切tanh指数和对数指数函数exp指数分解函数frexp乘积指数函数fdexp自然对数log以10为底的对数log10浮点数分解函数modf幂函数幂函数pow平方根函数sqrt整数截断,绝对值和求余数函数求下限接近整数ceil绝对值fabs求上限接近整数floor求余数fmod本分类函数用于实现在不同底函数之间直接跳转代码。

4 头文件setjmp.h io.h函数列表函数类别函数用途详细说明保存调用环境setjmp恢复调用环境longjmp信号处理该分类函数用于处理那些在程序执行过程中发生例外的情况。

C语言头文件使用大全

C语言头文件使用大全

头文件ctype.h函数列表<>函数类别函数用途详细说明字符测试是否字母和数字isalnum是否字母isalpha是否控制字符iscntrl是否数字isdigit是否可显示字符(除空格外)isgraph是否可显示字符(包括空格)isprint是否既不是空格,又不是字母和数字的可显示字符ispunct 是否空格isspace是否大写字母isupper是否16进制数字(0-9,A-F)字符isxdigit字符大小写转换函数转换为大写字母toupper转换为小写字母tolower地区化本类别的函数用于处理不同国家的语言差异。

头文件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整数截断,绝对值和求余数函数求下限接近整数ceil绝对值fabs求上限接近整数floor求余数fmod本分类函数用于实现在不同底函数之间直接跳转代码。

头文件setjmp.h io.h函数列表函数类别函数用途详细说明保存调用环境setjmp恢复调用环境longjmp信号处理该分类函数用于处理那些在程序执行过程中发生例外的情况。

C头文件大全

C头文件大全

C头文件大全(转)分类函数,所在函数库为ctype.hint isalpha(int ch) 若ch是字母('A'-'Z','a'-'z')返回非0值,否则返回0int isalnum(int ch) 若ch是字母('A'-'Z','a'-'z')或数字('0'-'9')返回非0值,否则返回0int isascii(int ch) 若ch是字符(ASCII码中的0-127)返回非0值,否则返回0int iscntrl(int ch) 若ch是作废字符(0x7F)或普通控制字符(0x00-0x1F)返回非0值,否则返回0int isdigit(int ch) 若ch是数字('0'-'9')返回非0值,否则返回0int isgraph(int ch) 若ch是可打印字符(不含空格)(0x21-0x7E)返回非0值,否则返回0int islower(int ch) 若ch是小写字母('a'-'z')返回非0值,否则返回0int isprint(int ch) 若ch是可打印字符(含空格)(0x20-0x7E)返回非0值,否则返回0int ispunct(int ch) 若ch是标点字符(0x00-0x1F)返回非0值,否则返回0int isspace(int ch) 若ch是空格(' '),水平制表符('\t'),回车符('\r'),走纸换行('\f'),垂直制表符('\v'),换行符('\n')返回非0值,否则返回0int isupper(int ch) 若ch是大写字母('A'-'Z')返回非0值,否则返回0int isxdigit(int ch) 若ch是16进制数('0'-'9','A'-'F','a'-'f')返回非0值,否则返回0int tolower(int ch) 若ch是大写字母('A'-'Z')返回相应的小写字母('a'-'z')int toupper(int ch) 若ch是小写字母('a'-'z')返回相应的大写字母('A'-'Z')数学函数,所在函数库为math.h、stdlib.h、string.h、float.hint abs(int i) 返回整型参数i的绝对值double cabs(struct complex znum) 返回复数znum的绝对值double fabs(double x) 返回双精度参数x的绝对值 long labs(long n) 返回长整型参数n的绝对值 double exp(double x) 返回指数函数ex的值double frexp(double value,int *eptr) 返回value=x*2n中x的值,n 存贮在eptr中double ldexp(double value,int exp); 返回value*2exp的值double log(double x) 返回logex的值double log10(double x) 返回log10x的值double pow(double x,double y) 返回xy的值double pow10(int p) 返回10p的值double sqrt(double x) 返回+√x的值double acos(double x) 返回x的反余弦cos-1(x)值,x 为弧度double asin(double x) 返回x的反正弦sin-1(x)值,x 为弧度double atan(double x) 返回x的反正切tan-1(x)值,x 为弧度double atan2(double y,double x) 返回y/x的反正切tan-1(x)值,y的x为弧度double cos(double x) 返回x的余弦cos(x)值,x 为弧度double sin(double x) 返回x的正弦sin(x)值,x 为弧度double tan(double x) 返回x的正切tan(x)值,x 为弧度double cosh(double x) 返回x的双曲余弦cosh(x)值,x为弧度double sinh(double x) 返回x的双曲正弦sinh(x)值,x为弧度double tanh(double x) 返回x的双曲正切tanh(x)值,x为弧度double hypot(double x,double y) 返回直角三角形斜边的长度(z),x和y为直角边的长度,z2=x2+y2double ceil(double x) 返回不小于x的最小整数double floor(double x) 返回不大于x的最大整数void srand(unsigned seed) 初始化随机数发生器int rand() 产生一个随机数并返回这个数double poly(double x,int n,double c[])从参数产生一个多项式double modf(double value,double *iptr)将双精度数value分解成尾数和阶double fmod(double x,double y) 返回x/y的余数double frexp(double value,int *eptr) 将双精度数value分成尾数和阶double atof(char *nptr) 将字符串nptr转换成浮点数并返回这个浮点数double atoi(char *nptr) 将字符串nptr转换成整数并返回这个整数double atol(char *nptr) 将字符串nptr转换成长整数并返回这个整数char *ecvt(double value,int ndigit,int *decpt,int *sign)将浮点数value转换成字符串并返回该字符串char *fcvt(double value,int ndigit,int *decpt,int *sign)将浮点数value转换成字符串并返回该字符串char *gcvt(double value,int ndigit,char *buf)将数value转换成字符串并存于buf中,并返回buf的指针char *ultoa(unsigned long value,char *string,int radix)将无符号整型数value转换成字符串并返回该字符串,radix为转换时所用基数char *ltoa(long value,char *string,int radix)将长整型数value转换成字符串并返回该字符串,radix为转换时所用基数char *itoa(int value,char *string,int radix)将整数value转换成字符串存入string,radix为转换时所用基数double atof(char *nptr) 将字符串nptr转换成双精度数,并返回这个数,错误返回0int atoi(char *nptr) 将字符串nptr转换成整型数, 并返回这个数,错误返回0long atol(char *nptr) 将字符串nptr转换成长整型数,并返回这个数,错误返回0double strtod(char *str,char **endptr)将字符串str转换成双精度数,并返回这个数,long strtol(char *str,char **endptr,int base)将字符串str转换成长整型数,并返回这个数,int matherr(struct exception *e)用户修改数学错误返回信息函数(没有必要使用)double _matherr(_mexcep why,char *fun,double *arg1p,double *arg2p,double retval)用户修改数学错误返回信息函数(没有必要使用)unsigned int _clear87() 清除浮点状态字并返回原来的浮点状态void _fpreset() 重新初使化浮点数学程序包unsigned int _status87() 返回浮点状态字目录函数,所在函数库为dir.h、dos.hint chdir(char *path) 使指定的目录path(如:"C:\\WPS")变成当前的工作目录,成功返回0int findfirst(char *pathname,struct ffblk *ffblk,int attrib)查找指定的文件,成功返回0pathname为指定的目录名和文件名,如"C:\\WPS\\TXT"ffblk为指定的保存文件信息的一个结构,定义如下:┏━━━━━━━━━━━━━━━━━━┓┃struct ffblk┃┃{┃┃ char ff_reserved[21]; /*DOS保留字*/┃┃ char ff_attrib; /*文件属性*/ ┃┃ int ff_ftime; /*文件时间*/ ┃┃ int ff_fdate; /*文件日期*/ ┃┃ long ff_fsize; /*文件长度*/ ┃┃ char ff_name[13]; /*文件名*/ ┃┃}┃┗━━━━━━━━━━━━━━━━━━┛attrib为文件属性,由以下字符代表┏━━━━━━━━━┳━━━━━━━━┓┃FA_RDONLY 只读文件┃FA_LABEL 卷标号┃┃FA_HIDDEN 隐藏文件┃FA_DIREC 目录┃┃FA_SYSTEM 系统文件┃FA_ARCH档案┃┗━━━━━━━━━┻━━━━━━━━┛例:struct ffblk ff;findfirst("*.wps",&ff,FA_RDONLY);int findnext(struct ffblk *ffblk) 取匹配finddirst的文件,成功返回0void fumerge(char *path,char *drive,char *dir,char *name,char *ext)此函数通过盘符drive(C:、A:等),路径dir(\TC、\BC\LIB等),文件名name(TC、WPS等),扩展名ext(.EXE、.COM等)组成一个文件名存与path中.int fnsplit(char *path,char *drive,char *dir,char *name,char *ext)此函数将文件名path分解成盘符drive(C:、A:等),路径dir(\TC、\BC\LIB等),文件名name(TC、WPS等),扩展名ext(.EXE、.COM等),并分别存入相应的变量中.int getcurdir(int drive,char *direc) 此函数返回指定驱动器的当前工作目录名称drive 指定的驱动器(0=当前,1=A,2=B,3=C等)direc 保存指定驱动器当前工作路径的变量成功返回0 char *getcwd(char *buf,iint n) 此函数取当前工作目录并存入buf中,直到n个字节长为为止.错误返回NULLint getdisk() 取当前正在使用的驱动器,返回一个整数(0=A,1=B,2=C等)int setdisk(int drive) 设置要使用的驱动器drive(0=A,1=B,2=C等), 返回可使用驱动器总数int mkdir(char *pathname) 建立一个新的目录pathname,成功返回0 int rmdir(char *pathname) 删除一个目录pathname,成功返回0char *mktemp(char *template) 构造一个当前目录上没有的文件名并存于template中char *searchpath(char *pathname) 利用MSDOS找出文件filename所在路径,,此函数使用DOS的PATH变量,未找到文件返回NULL进程函数,所在函数库为stdlib.h、process.hvoid abort() 此函数通过调用具有出口代码3的_exit写一个终止信息于stderr,并异常终止程序。

最为完整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语言头文件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.h>内存管理声明<sys/select.h>select函数<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>动态链接<fmtmsg.h>消息显示结构<ftw.h>文件树漫游<iconv.h>代码集转换实用程序<langinfo.h>语言信息常量<libgen.h>模式匹配函数定义<monetary.h>货币类型<ndbm.h>数据库操作<nl_types.h>消息类别<poll.h>轮询函数<search.h>搜索表<strings.h>字符串操作<syslog.h>系统出错日志记录<ucontext.h>用户上下文<ulimit.h>用户限制<utmpx.h>用户帐户数据库<sys/ipc.h>IPC<sys/msg.h>消息队列<sys/resource.h>资源操作<sys/sem.h>信号量<sys/shm.h>共享存储<sys/statvfs.h>文件系统信息<sys/time.h>时间类型<sys/timeb.h>附加的时间<sys/uio.h>矢量I/O操作POSIX标准定义的可选头文件(8项)<aio.h>异步I/O<mqueue.h>消息队列<pthread.h>线程<sched.h>执行调度<semaphore.h>信号量<spawn.h>实时spawn接口<stropts.h>XSI STREAMS接口<trace.h>时间跟踪标准C++语言头文件(54个其中16个用于构建STL,3个为附加非必须)<algorithm>STL通用算法<bitset>STL位集容器<cassert>用于在程序运行时执行断言<cctype>字符处理<cerrno>错误码<cfloat>用于测试浮点类型属性<ciso646>ISO646变体字符集<climits>测试整数类型属性<clocale>本地化函数<cmath>数学函数<complex>复数类<csetjmp>执行非内部的goto语句<csignal>信号<cstdarg>访问参数数量变化的函数<cstddef>用于定义实用的类型和宏<cstdio>输入/输出<cstdlib>杂项函数及内存分配<cstring>字符串<ctime>时间<cwchar>宽字符处理及输入/输出<cwctype>宽字符分类<deque>STL双端队列容器<exception>异常处理类<fstream>文件流<functional>STL函数对象<iomanip>参数化输入/输出<ios>基本输入/输出支持<iosfwd>输入/输出前置声明<iostream>数据流输入/输出<istream>基本输入流<iterator>遍历序列的类<limits>各种数据类型最值常量<list>STL线性列表容器<locale>国际化支持<map>STL映射容器<memory>专用内存分配器<new>基本内存分配和释放<numeric>通用的数字操作<ostream>基本输出流<queue>STL队列容器<set>STL集合容器<sstream>基于字符串的流<stack>STL堆栈容器<stdexcept>标准异常类<streambuf>iostream的缓冲区类<string>字符串类<strstream>非内存字符序列的流类<typeinfo>运行时类型标识<utility>STL通用模板类<valarray>支持值数组的类和模版类<vector>STL动态数组容器标准C++附加的头文件(3个)非必须<hash_map><hash_set><slist>The Standard C++library consists of51required headers.This implementation also includes three additional headers,<hash_map>,<hash_set>,and<slist>,not required by the C++Standard,for a total of54headers.Of these54headers,16constitute the 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 for the templates defined in<algorithm>and<numeric><hash_map>--(STL)for defining template classes that implement hashed associative containers that map keys to values<hash_set>--(STL)for defining template classes that implement hashed associative containers <iomanip>--for declaring several iostreams manipulators that take an argument<ios>--for defining the template class that serves as the base for many iostreams classes <iosfwd>--for declaring several iostreams template classes before they are necessarily defined<iostream>--for declaring the iostreams objects that manipulate the standard streams<istream>--for defining the template class that performs extractions<iterator>--(STL)for defining several templates that help define and manipulate iterators <limits>--for testing numeric type properties<list>--(STL)for defining a template class that implements a doubly linked list container <locale>--for defining several classes and templates that controllocale-specific behavior,as in the iostreams classes<map>--(STL)for defining template classes that implement associative containers that map keys to values<memory>--(STL)for defining several templates that allocate and free storage for various container classes<new>--for declaring several functions that allocate and free storage<numeric>--(STL)for defining several templates that implement useful numeric functions<ostream>--for defining the template class that performs insertions<queue>--(STL)for defining a template class that implements a queue container<set>--(STL)for defining template classes that implement associative containers<slist>--(STL)for defining a template class that implements a singly linked list container <sstream>--for defining several iostreams template classes that manipulate string containers <stack>--(STL)for defining a template class that implements a stack container<stdexcept>--for defining several classes useful for reporting exceptions<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<utility>--(STL)for defining several templates of general utility<valarray>--for defining several classes and template classes that support value-oriented arrays<vector>--(STL)for defining a template class that implements a vector container新的C标准库<cassert>--for enforcing assertions when functions execute<cctype>--for classifying characters<cerrno>--for testing error codes reported by library functions<cfloat>--for testing floating-point type properties<ciso646>--for programming in ISO646variant character sets<climits>--for testing integer type properties<clocale>--for adapting to different cultural conventions<cmath>--for computing common mathematical functions<csetjmp>--for executing nonlocal goto statements<csignal>--for controlling various exceptional conditions<cstdarg>--for accessing a varying number of arguments<cstddef>--for defining several useful types and macros<cstdio>--for performing input and output<cstdlib>--for performing a variety of operations<cstring>--for manipulating several kinds of strings<ctime>--for converting between various time and date formats<cwchar>--for manipulating wide streams and several kinds of strings<cwctype>--for classifying wide characters旧的C标准库<assert.h>--for enforcing assertions when functions execute<ctype.h>--for classifying characters<errno.h>--for testing error codes reported by library functions<float.h>--for testing floating-point type properties<iso646.h>--for programming in ISO646variant character sets<limits.h>--for testing integer type properties<locale.h>--for adapting to different cultural conventions<math.h>--for computing common mathematical functions<setjmp.h>--for executing nonlocal goto statements<signal.h>--for controlling various exceptional conditions<stdarg.h>--for accessing a varying number of arguments<stddef.h>--for defining several useful types and macros<stdio.h>--for performing input and output<stdlib.h>--for performing a variety of operations<string.h>--for manipulating several kinds of strings<time.h>--for converting between various time and date formats<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<new.h>--for declaring several functions that allocate and free storage<stl.h>--for declaring several template classes that aid migration from older versions of the Standard Template Library//////////////////////////////////////////////////////////////////////////标准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头文件大全--------------------------------------------------------------------------------------------------------------------------------------------分类函数,所在函数库为ctype.hint isalpha(int ch)若ch是字母('A'-'Z','a'-'z')返回非0值,否则返回0int isalnum(int ch)若ch是字母('A'-'Z','a'-'z')或数字('0'-'9')返回非0值,否则返回0int isascii(int ch)若ch是字符(ASCII码中的0-127)返回非0值,否则返回0int iscntrl(int ch)若ch是作废字符(0x7F)或普通控制字符(0x00-0x1F)返回非0值,否则返回0int isdigit(int ch)若ch是数字('0'-'9')返回非0值,否则返回0int isgraph(int ch)若ch是可打印字符(不含空格)(0x21-0x7E)返回非0值,否则返回0int islower(int ch)若ch是小写字母('a'-'z')返回非0值,否则返回0int isprint(int ch)若ch是可打印字符(含空格)(0x20-0x7E)返回非0值,否则返回0int ispunct(int ch)若ch是标点字符(0x00-0x1F)返回非0值,否则返回0int isspace(int ch)若ch是空格(''),水平制表符('\t'),回车符('\r'),走纸换行('\f'),垂直制表符('\v'),换行符('\n')返回非0值,否则返回0int isupper(int ch)若ch是大写字母('A'-'Z')返回非0值,否则返回0int isxdigit(int ch)若ch是16进制数('0'-'9','A'-'F','a'-'f')返回非0值,否则返回0int tolower(int ch)若ch是大写字母('A'-'Z')返回相应的小写字母('a'-'z')int toupper(int ch)若ch是小写字母('a'-'z')返回相应的大写字母('A'-'Z')--------------------------------------------------------------------------------------------------------------------------------------------数学函数,所在函数库为math.h、stdlib.h、string.h、float.hint abs(int i)返回整型参数i的绝对值double cabs(struct complex znum)返回复数znum的绝对值double fabs(double x)返回双精度参数x的绝对值long labs(long n)返回长整型参数n的绝对值double exp(double x)返回指数函数ex的值double frexp(double value,int*eptr)返回value=x*2n中x的值,n存贮在eptr中double ldexp(double value,int exp);返回value*2exp的值double log(double x)返回logex的值double log10(double x)返回log10x的值double pow(double x,double y)返回xy的值double pow10(int p)返回10p的值double sqrt(double x)返回+√x的值double acos(double x)返回x的反余弦cos-1(x)值,x为弧度double asin(double x)返回x的反正弦sin-1(x)值,x为弧度double atan(double x)返回x的反正切tan-1(x)值,x为弧度double atan2(double y,double x)返回y/x的反正切tan-1(x)值,y的x为弧度double cos(double x)返回x的余弦cos(x)值,x为弧度double sin(double x)返回x的正弦sin(x)值,x为弧度double tan(double x)返回x的正切tan(x)值,x为弧度double cosh(double x)返回x的双曲余弦cosh(x)值,x为弧度double sinh(double x)返回x的双曲正弦sinh(x)值,x为弧度double tanh(double x)返回x的双曲正切tanh(x)值,x为弧度double hypot(double x,double y)返回直角三角形斜边的长度(z),x和y为直角边的长度,z2=x2+y2double ceil(double x)返回不小于x的最小整数double floor(double x)返回不大于x的最大整数void srand(unsigned seed)初始化随机数发生器int rand()产生一个随机数并返回这个数double poly(double x,int n,double c[])从参数产生一个多项式double modf(double value,double*iptr)将双精度数value分解成尾数和阶double fmod(double x,double y)返回x/y的余数double frexp(double value,int*eptr)将双精度数value分成尾数和阶double atof(char*nptr)将字符串nptr转换成浮点数并返回这个浮点数double atoi(char*nptr)将字符串nptr转换成整数并返回这个整数double atol(char*nptr)将字符串nptr转换成长整数并返回这个整数char*ecvt(double value,int ndigit,int*decpt,int*sign)将浮点数value转换成字符串并返回该字符串char*fcvt(double value,int ndigit,int*decpt,int*sign)将浮点数value转换成字符串并返回该字符串char*gcvt(double value,int ndigit,char*buf)将数value转换成字符串并存于buf中,并返回buf的指针char*ultoa(unsigned long value,char*string,int radix)将无符号整型数value转换成字符串并返回该字符串,radix 为转换时所用基数char*ltoa(long value,char*string,int radix)将长整型数value转换成字符串并返回该字符串,radix为转换时所用基数char*itoa(int value,char*string,int radix)将整数value转换成字符串存入string,radix为转换时所用基数double atof(char*nptr)将字符串nptr转换成双精度数,并返回这个数,错误返回0int atoi(char*nptr)将字符串nptr转换成整型数,并返回这个数,错误返回0long atol(char*nptr)将字符串nptr转换成长整型数,并返回这个数,错误返回0double strtod(char*str,char**endptr)将字符串str转换成双精度数,并返回这个数,long strtol(char*str,char**endptr,int base)将字符串str转换成长整型数,并返回这个数,int matherr(struct exception*e)用户修改数学错误返回信息函数(没有必要使用)double_matherr(_mexcep why,char*fun,double*arg1p,double*arg2p,double retval)用户修改数学错误返回信息函数(没有必要使用)unsigned int_clear87()清除浮点状态字并返回原来的浮点状态void_fpreset()重新初使化浮点数学程序包unsigned int_status87()返回浮点状态字--------------------------------------------------------------------------------------------------------------------------------------------目录函数,所在函数库为dir.h、dos.hint chdir(char*path)使指定的目录path(如:"C:\\WPS")变成当前的工作目录,成功返回0int findfirst(char*pathname,struct ffblk*ffblk,int attrib)查找指定的文件,成功返回0pathname为指定的目录名和文件名,如"C:\\WPS\\TXT"ffblk为指定的保存文件信息的一个结构,定义如下:┏━━━━━━━━━━━━━━━━━━┓┃struct ffblk┃┃{┃┃char ff_reserved[21];┃┃char ff_attrib;┃┃int ff_ftime;┃┃int ff_fdate;┃┃long ff_fsize;┃┃char ff_name[13];┃┃}┃┗━━━━━━━━━━━━━━━━━━┛attrib为文件属性,由以下字符代表┏━━━━━━━━━┳━━━━━━━━┓┃FA_RDONLY只读文件┃FA_LABEL卷标号┃┃FA_HIDDEN隐藏文件┃FA_DIREC目录┃┃FA_SYSTEM系统文件┃FA_ARCH档案┃┗━━━━━━━━━┻━━━━━━━━┛例:struct ffblk ff;findfirst("*.wps",&ff,FA_RDONLY);int findnext(struct ffblk*ffblk)取匹配finddirst的文件,成功返回0void fumerge(char*path,char*drive,char*dir,char*name,char*ext)此函数通过盘符drive(C:、A:等),路径dir(\TC、\BC\LIB等),文件名name(TC、WPS等),扩展名ext(.EXE、.COM等)组成一个文件名存与path中.int fnsplit(char*path,char*drive,char*dir,char*name,char*ext)此函数将文件名path分解成盘符drive(C:、A:等),路径dir(\TC、\BC\LIB等),文件名name(TC、WPS等),扩展名ext(.EXE、.COM等),并分别存入相应的变量中.int getcurdir(int drive,char*direc)此函数返回指定驱动器的当前工作目录名称drive指定的驱动器(0=当前,1=A,2=B,3=C等)direc保存指定驱动器当前工作路径的变量成功返回0char*getcwd(char*buf,iint n)此函数取当前工作目录并存入buf中,直到n个字节长为为止.错误返回NULLint getdisk()取当前正在使用的驱动器,返回一个整数(0=A,1=B,2=C等)int setdisk(int drive)设置要使用的驱动器drive(0=A,1=B,2=C等),返回可使用驱动器总数int mkdir(char*pathname)建立一个新的目录pathname,成功返回0int rmdir(char*pathname)删除一个目录pathname,成功返回0char*mktemp(char*template)构造一个当前目录上没有的文件名并存于template中char*searchpath(char*pathname)利用MSDOS找出文件filename所在路径,,此函数使用DOS的PATH变量,未找到文件返回NULL--------------------------------------------------------------------------------------------------------------------------------------------进程函数,所在函数库为stdlib.h、process.hvoid abort()此函数通过调用具有出口代码3的_exit写一个终止信息于stderr,并异常终止程序。

C语言头文件大全

C语言头文件大全

标准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.h> 内存管理声明<sys/select.h> select函数<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> 动态链接<fmtmsg.h> 消息显示结构<ftw.h> 文件树漫游<iconv.h> 代码集转换实用程序<langinfo.h> 语言信息常量<libgen.h> 模式匹配函数定义<monetary.h> 货币类型<ndbm.h> 数据库操作<nl_types.h> 消息类别<poll.h> 轮询函数<search.h> 搜索表<strings.h> 字符串操作<syslog.h> 系统出错日志记录<ucontext.h> 用户上下文<ulimit.h> 用户限制<utmpx.h> 用户帐户数据库<sys/ipc.h> IPC<sys/msg.h> 消息队列<sys/resource.h> 资源操作<sys/sem.h> 信号量<sys/shm.h> 共享存储<sys/statvfs.h> 文件系统信息<sys/time.h> 时间类型<sys/timeb.h> 附加的时间<sys/uio.h> 矢量I/O操作POSIX标准定义的可选头文件(8项)<aio.h> 异步I/O <mqueue.h> 消息队列<pthread.h> 线程<sched.h> 执行调度<semaphore.h> 信号量<spawn.h> 实时spawn接口<stropts.h> XSI STREAMS接口<trace.h> 时间跟踪标准 C++ 语言头文件(54个其中16个用于构建STL,3个为附加非必须)<algorithm>STL通用算法<bitset> STL位集容器<cassert> 用于在程序运行时执行断言<cctype> 字符处理<cerrno> 错误码<cfloat> 用于测试浮点类型属性<ciso646> ISO646变体字符集<climits> 测试整数类型属性<clocale> 本地化函数<cmath> 数学函数<complex>复数类<csetjmp> 执行非内部的goto语句<csignal> 信号<cstdarg> 访问参数数量变化的函数<cstddef> 用于定义实用的类型和宏<cstdio> 输入/输出<cstdlib> 杂项函数及内存分配<cstring> 字符串<ctime> 时间<cwchar> 宽字符处理及输入/输出<cwctype> 宽字符分类<deque> STL双端队列容器<exception> 异常处理类<fstream> 文件流<functional> STL函数对象<iomanip> 参数化输入/输出<ios>基本输入/输出支持<iosfwd> 输入/输出前置声明<iostream> 数据流输入/输出<istream> 基本输入流<iterator> 遍历序列的类<limits> 各种数据类型最值常量<list>STL线性列表容器<locale> 国际化支持<map> STL映射容器<memory> 专用内存分配器<new> 基本内存分配和释放<numeric> 通用的数字操作<ostream> 基本输出流<queue> STL 队列容器<set> STL 集合容器<sstream> 基于字符串的流<stack> STL 堆栈容器<stdexcept> 标准异常类<streambuf> iostream 的缓冲区类<string> 字符串类<strstream> 非内存字符序列的流类<typeinfo> 运行时类型标识<utility> STL 通用模板类<valarray> 支持值数组的类和模版类<vector> 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 constitute the 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 for the templates defined in <algorithm> and <numeric><hash_map> -- (STL) for defining template classes that implement hashed associative containersthat map keys to values<hash_set> -- (STL) for defining template classes that implement hashed associative containers<iomanip> -- for declaring several iostreams manipulators that take an argument<ios> -- for defining the template class that serves as the base for many iostreams classes<iosfwd> -- for declaring several iostreams template classes before they are necessarilydefined<iostream> -- for declaring the iostreams objects that manipulate the standard streams<istream> -- for defining the template class that performs extractions<iterator> -- (STL) for defining several templates that help define and manipulate iterators<limits> -- for testing numeric type properties<list>-- (STL) for defining a template class that implements a doubly linked list container<locale> -- for defining several classes and templates that controllocale-specific behavior, as in the iostreams classes<map>-- (STL) for defining template classes that implement associative containers thatmap keys to values<memory>-- (STL) for defining several templates that allocate and free storage for variouscontainer classes<new> -- for declaring several functions that allocate and free storage<numeric>-- (STL) for defining several templates that implement useful numeric functions<ostream> -- for defining the template class that performs insertions<queue> -- (STL) for defining a template class that implements a queue container<set>-- (STL) for defining template classes that implement associative containers<slist>-- (STL) for defining a template class that implements a singly linked list container<sstream> -- for defining several iostreams template classes that manipulate string containers<stack> -- (STL) for defining a template class that implements a stack container<stdexcept> -- for defining several classes useful for reporting exceptions<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<utility>-- (STL) for defining several templates of general utility<valarray> -- for defining several classes and template classes that support value-oriented arrays<vector>-- (STL) for defining a template class that implements a vector container新的C标准库<cassert> -- for enforcing assertions when functions execute<cctype> -- for classifying characters<cerrno> -- for testing error codes reported by library functions<cfloat> -- for testing floating-point type properties<ciso646> -- for programming in ISO 646 variant character sets<climits> -- for testing integer type properties<clocale> -- for adapting to different cultural conventions<cmath> -- for computing common mathematical functions<csetjmp> -- for executing nonlocal goto statements<csignal> -- for controlling various exceptional conditions<cstdarg> -- for accessing a varying number of arguments<cstddef> -- for defining several useful types and macros<cstdio> -- for performing input and output<cstdlib> -- for performing a variety of operations<cstring> -- for manipulating several kinds of strings<ctime> -- for converting between various time and date formats<cwchar> -- for manipulating wide streams and several kinds of strings<cwctype> -- for classifying wide characters旧的C标准库<assert.h> -- for enforcing assertions when functions execute<ctype.h> -- for classifying characters<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 cultural conventions<math.h> -- for computing common mathematical functions<setjmp.h> -- for executing nonlocal goto statements<signal.h> -- for controlling various exceptional conditions<stdarg.h> -- for accessing a varying number of arguments<stddef.h> -- for defining several useful types and macros<stdio.h> -- for performing input and output<stdlib.h> -- for performing a variety of operations<string.h> -- for manipulating several kinds of strings<time.h> -- for converting between various time and date formats<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 <new.h> -- for declaring several functions that allocate and free storage<stl.h> -- for declaring several template classes that aid migration from older versions of the Standard Template Library。

C语言 函数大全(头文件)

C语言 函数大全(头文件)

C标准库函数abort stdlib. h abs stdlib. h acos math. h asctime time. h asin math. h assert assert.h atan math. h atan2 math. h atexit stdlib. hatof stdlib. h atoi stdlib. h atol stdlib. h bsearch stdlib. h BUFSIZ stdio. h calloc stdlib. hceil math. h clearerr stdio. h clock time. h CLOCKS-PER-SEC time. h clock_t time. hcos math. h cosh math. h ctime time. h difftime time. hdiv stdlib. hdiv_t stdlib. h EDOM errno. h EOF stdio. h ERANGE errno. h errno errno. h exit stdlib. h EXIT_FAILURE stdlib. h EXIT_SUCCESS stdlib. h exp math. h fabs math. h fclose stdio. hfeof stdio.h ferror stdio.h fflush stdio. h fgetc stdio.h fgetpos stdio. hFILE stdio. h FILENAME-MAX stdio. h floor math. h isalpha ctype. h iscntrl ctype. h isdigit ctype. h isgraph ctype. h islower ctype. h isprint ctype. h ispunct ctype. h isspace ctype. h isupper ctype. h isxdigit ctype. hjmp_buf setjmp. h labs stdlib. hLC_ALL locale. h LC_COLLATE locale. h LC_CTYPE locale. h LC_MONETARY locale. h LC_NUMERIC locale. h LC_TIME locale. h struct lconv locale. h ldexp math. hldiv stdlib. hldiv_t stdlib. h localeconv locale. h localtime time. hlog math. hlog10 math. h longjmp setjmp. hL_tmpnam stdio. h malloc stdlib. h mblen stdlib. h mbstowcs stdlib. h mbtowc stdlib. h MB_CUR_MAX stdlib. h memchr string. h memcmp string. h memcpy string. h memmove string. h memset string. hmodf math. hNDEBUG assert. hNULL locale. h.stddef. h.stdio. h.stdlib. h.string.h.time. hoffsetof stddef. hperror stdio.hpow math. hprintf stdio.hptrdiff_t stddef. hputc stdio. hputchar stdio. hstrpbrk string. hstrrchr string. hstrspn string. hstrstr string. hstrtod stdlib. hstrtok string. hstrtol stdlib. hstrtoul stdlib. hstrxfrm string. hsystem stblib. htan math. htanh math. htime time. htime_t time. hstruct tm time. htmpfile stdio. htmpnam stdio. hTMP_MAX stdio. htolower ctype. htoupper ctype. hungetc stdio. hva_arg stdarg. hva_end stdarg. hvalist stdarg. hva_ start stdarg. hvfprintf stdio. hvprintf stdio. hvsprintf stdio. hwchar_t stddef. h. stdlib. hwcstombs stdlib. hwctomb stdlib. h。

C语言头文件大全修订版

C语言头文件大全修订版

C语言头文件大全修订版IBMT standardization office【IBMT5AB-IBMT08-IBMT2C-ZZT18】标准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.h>?内存管理声明<sys/select.h>?select函数<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>?动态链接<fmtmsg.h>?消息显示结构<ftw.h>?文件树漫游<iconv.h>?代码集转换实用程序<langinfo.h>?语言信息常量<libgen.h>?模式匹配函数定义<monetary.h>?货币类型<ndbm.h>?数据库操作<nl_types.h>?消息类别<poll.h>?轮询函数<search.h>?搜索表<strings.h>?字符串操作<syslog.h>?系统出错日志记录<ucontext.h>?用户上下文<ulimit.h>?用户限制<utmpx.h>?用户帐户数据库<sys/ipc.h> IPC<sys/msg.h>?消息队列<sys/resource.h> 资源操作<sys/sem.h>?信号量<sys/shm.h>?共享存储<sys/statvfs.h>?文件系统信息<sys/time.h>?时间类型<sys/timeb.h>?附加的时间<sys/uio.h>?矢量I/O操作POSIX标准定义的可选头文件(8项)<aio.h>?异步I/O <mqueue.h>?消息队列<pthread.h>?线程<sched.h>?执行调度<semaphore.h> 信号量<spawn.h>?实时spawn接口<stropts.h>?XSI STREAMS接口<trace.h>?时间跟踪标准 C++ 语言头文件(54个其中16个用于构建STL,3个为附加非必须)<algorithm> STL通用算法<bitset> STL位集容器<cassert>?用于在程序运行时执行断言<cctype> 字符处理<cerrno> 错误码<cfloat>?用于测试浮点类型属性<ciso646>?ISO646变体字符集<climits>?测试整数类型属性<clocale> 本地化函数<cmath> 数学函数<complex> 复数类<csetjmp>?执行非内部的goto语句<csignal>?信号<cstdarg>?访问参数数量变化的函数<cstddef>?用于定义实用的类型和宏<cstdio> 输入/输出<cstdlib> 杂项函数及内存分配<cstring> 字符串<ctime> 时间<cwchar> 宽字符处理及输入/输出<cwctype> 宽字符分类<deque> STL双端队列容器<exception> 异常处理类<fstream> 文件流<functional> STL函数对象<iomanip> 参数化输入/输出<ios> 基本输入/输出支持<iosfwd> 输入/输出前置声明<iostream> 数据流输入/输出<istream> 基本输入流<iterator> 遍历序列的类<limits> 各种数据类型最值常量<list> STL 线性列表容器<locale> 国际化支持<map> STL映射容器<memory> 专用内存分配器<new> 基本内存分配和释放? <numeric> 通用的数字操作<ostream> 基本输出流<queue> STL 队列容器<set> STL 集合容器<sstream> 基于字符串的流<stack> STL 堆栈容器<stdexcept> 标准异常类<streambuf> iostream 的缓冲区类<string> 字符串类<strstream>?非内存字符序列的流类<typeinfo> 运行时类型标识<utility> STL 通用模板类<valarray>?支持值数组的类和模版类<vector> 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 constitute the 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 values<hash_set> -- (STL) for defining template classes that implement hashed associative containers<iomanip> -- for declaring several iostreams manipulators that take an argument<ios> -- for defining the template class that serves as the base for many iostreams classes<iosfwd> -- for declaring several iostreams template classes before they are necessarilydefined<iostream> -- for declaring the iostreams objects that manipulate the standard streams<istream> -- for defining the template class that performs extractions<iterator> -- (STL) for defining several templates that help define and manipulate iterators<limits> -- for testing numeric type properties<list>-- (STL) for defining a template class that implements a doubly linked list container<locale> -- for defining several classes and templates that controllocale-specific behavior, as in the iostreams classes<map>-- (STL) for defining template classes that implement associative containers thatmap keys to values<memory>-- (STL) for defining several templates that allocate and free storage for variouscontainer classes<new> -- for declaring several functions that allocate and free storage<numeric>-- (STL) for defining several templates that implement useful numeric functions<ostream> -- for defining the template class that performs insertions<queue> -- (STL) for defining a template class that implements a queue container<set>-- (STL) for defining template classes that implement associative containers<slist>-- (STL) for defining a template class that implements a singly linked list container<sstream> -- for defining several iostreams template classes that manipulate string containers<stack> -- (STL) for defining a template class that implements a stack container<stdexcept> -- for defining several classes useful for reporting exceptions<streambuf> -- for defining template classes that buffer iostreams operations <string> -- for defining a template class that implements a stringcontainer<strstream> -- for defining several iostreams classes that manipulate in-memory charactersequences<typeinfo> -- for defining class type_info, the result of the typeid operator <utility>-- (STL) for defining several templates of general utility<valarray> -- for defining several classes and template classes that support value-orientedarrays<vector>-- (STL) for defining a template class that implements a vector container新的C标准库<cassert> -- for enforcing assertions when functions execute<cctype> -- for classifying characters<cerrno> -- for testing error codes reported by library functions<cfloat> -- for testing floating-point type properties<ciso646> -- for programming in ISO 646 variant character sets<climits> -- for testing integer type properties<clocale> -- for adapting to different cultural conventions<cmath> -- for computing common mathematical functions<csetjmp> -- for executing nonlocal goto statements<csignal> -- for controlling various exceptional conditions<cstdarg> -- for accessing a varying number of arguments<cstddef> -- for defining several useful types and macros<cstdio> -- for performing input and output<cstdlib> -- for performing a variety of operations<cstring> -- for manipulating several kinds of strings<ctime> -- for converting between various time and date formats<cwchar> -- for manipulating wide streams and several kinds of strings <cwctype> -- for classifying wide characters旧的C标准库<assert.h> -- for enforcing assertions when functions execute<ctype.h> -- for classifying characters<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 cultural conventions<math.h> -- for computing common mathematical functions<setjmp.h> -- for executing nonlocal goto statements<signal.h> -- for controlling various exceptional conditions<stdarg.h> -- for accessing a varying number of arguments<stddef.h> -- for defining several useful types and macros<stdio.h> -- for performing input and output<stdlib.h> -- for performing a variety of operations<string.h> -- for manipulating several kinds of strings<time.h> -- for converting between various time and date formats<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<new.h> -- for declaring several functions that allocate and free storage <stl.h> -- for declaring several template classes that aid migration from older versionsof the Standard Template Library。

C,C 各种头文件名称

C,C  各种头文件名称

的却没有呢??很苦恼啊??使用随机数时候有什么基本的使用方法,请多讲讲啊!!不好意思, 一次问的有点多,请帮帮忙吧~~
A:理论上,随机数不是随机产生的,他是有规律的,比如 srand(1)到 srand(100000) 里面,有 100000 个种子,就是说你有 100000 个数可以选择,我们称之为随机,其实 主要关键是种子 srand 的选择是不是接近随机(不存在完全随机),书上说最好用的是时 间,因为时间的数值随时间变化而变化,运行两次,一般不会出现前一次和后一次相同的局 面,所以看上去就有点像随机了。 比如 这里是 c++,c 的我忘记了。 #include <time.h> int a[10],b; srand(time(0)); for (b=0;b<10;b++) a[b]=rand()%100; 上面说的是用时间来作为种子,一天内不会重复,精确到秒,第二天,如果你的软件一直开 着,就是说有 1/(60*60*24)个可能会重复。如果长期使用,平均每使用 60*60*24 次, 有一个概率会重复,当你发现重复现象,那时你把软件关掉,再开启,好像就可以重新安排 种子里面的数字了。当然,条件是你有足够的数可供选择,所以 a[b]=rand()%100;中的 100 可以写成 60*60*24。 我上一个完整的 c++程序,你下载 dev-c++,运行一个就会发现问题。c 的我忘的一干二 净,真的写不出来。
================================================ ====================
标准 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 映射容器

c语言头文件(常用)

c语言头文件(常用)

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语言头文件

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语言函数大全(头文件)

C语言函数大全(头文件)

C语言函数大全(头文件)C标准库函数abort stdlib. h abs stdlib. h acos math. h asctime time. h asin math. h assert assert.h atan math. h atan2 math. h atexit stdlib. h atof stdlib. h atoi stdlib. h atol stdlib. h bsearch stdlib. h BUFSIZ stdio. h calloc stdlib. hceil math. h clearerr stdio. h clock time. h CLOCKS-PER-SEC time. h clock_t time. hcos math. h cosh math. h ctime time. h difftime time. hdiv stdlib. hdiv_t stdlib. h EDOM errno. h EOF stdio. h ERANGE errno. h errno errno. h exit stdlib. h EXIT_FAILURE stdlib. h EXIT_SUCCESS stdlib. h exp math. h fabs math. h fclose stdio. hfeof stdio.h ferror stdio.h fflush stdio. h fgetc stdio.h fgetpos stdio. hFILE stdio. h FILENAME-MAX stdio. h floor math. h isalpha ctype. h iscntrl ctype. h isdigit ctype. h isgraph ctype. h islower ctype. h isprint ctype. h ispunct ctype. h isspace ctype. h isupper ctype. h isxdigit ctype. hjmp_buf setjmp. h labs stdlib. hLC_ALL locale. h LC_COLLATE locale. h LC_CTYPE locale. h LC_MONETARY locale. h LC_NUMERIC locale. h LC_TIME locale. h struct lconv locale. h ldexp math. hldiv stdlib. hldiv_t stdlib. h localeconv locale. h localtime time. hlog math. hlog10 math. h longjmp setjmp. hL_tmpnam stdio. h malloc stdlib. h mblen stdlib. h mbstowcs stdlib. h mbtowc stdlib. h MB_CUR_MAX stdlib. h memchr string.h memcmp string. h memcpy string. h memmove string. h memset string. hmodf math. hNDEBUG assert. hNULL locale. h.stddef. h.stdio. h.stdlib. h.string.h.time. hoffsetof stddef. hperror stdio.hpow math. hprintf stdio.hptrdiff_t stddef. hputc stdio. hputchar stdio. hstrpbrk string. hstrrchr string. hstrspn string. hstrstr string. hstrtod stdlib. hstrtok string. hstrtol stdlib. hstrtoul stdlib. hstrxfrm string. hsystem stblib. htan math. htanh math. htime time. htime_t time. hstruct tm time. htmpfile stdio. htmpnam stdio. hTMP_MAX stdio. h tolower ctype. h toupper ctype. h ungetc stdio. hva_arg stdarg. hva_end stdarg. hvalist stdarg. hva_ start stdarg. h vfprintf stdio. hvprintf stdio. hvsprintf stdio. hwchar_t stddef. h. stdlib. h wcstombs stdlib. h wctomb stdlib. h。

标准C语言头文件

标准C语言头文件

标准C语⾔头⽂件ISO C标准定义的头⽂件(24项)1. <assert.h>验证程序断⾔2. <complex.h> ⽀持复数算术运算3. <ctype.h> 字符类型4. <errno.h> 出错码5. <fenv.h> 浮点环境6. <float.h> 浮点常量7. <inttypes.h> 整型格式转换8. <iso646.h> 替代关系操作符宏9. <limits.h> 实现常量10. <locale.h> 局部类别11. <math.h> 数学常量12. <setjmp.h> ⾮局部goto13. <signal.h> 信号14. <stdarg.h> 可变参数表15. <stdbool.h> 布尔类型和值16. <stddef.h> 标准定义17. <stdint.h> 整型18. <stdio.h> 标准I/O库19. <stdlib.h> 实⽤程序库函数20. <string.h> 字符串操作21. <tgmath.h> 通⽤类型数学宏22. <time.h> ⽇期和时间23. <wchar.h> 宽字符⽀持24. <wctype.h> 宽字符分类和映射⽀持POSIX标准定义的必须的头⽂件(26项)1. <dirent.h> ⽬录项2. <fcntl.h>———————-⽂件控制3. <fnmatch.h> ⽂件名匹配类型4. <glob.h> 路径名模式匹配类型5. <grp.h> 组⽂件6. <netdb.h> ⽹络数据库操作7. <pwd.h> ⼝令⽂件8. <regex.h> 正则表达式9. <tar.h> tar归档值10. <termios.h> 终端I/O11. <unistd.h> 符号常量12. <utime.h> ———————-⽂件时间13. <wordexp.h> 字扩展类型14. <arpa/inet.h> Internet定义15. <net/if.h> 套接字本地接⼝16. <netinet/in.h> Internet地址族17. <netinet/tcp.h>———————-传输控制协议定义18. <sys/mman.h> 内存管理声明19. <sys/select.h> select函数20. <sys/socket.h> 套接字接⼝21. <sys/stat.h> ⽂件状态22. <sys/times.h> ———————-进程时间23. <sys/types.h> 基本系统数据类型24. <sys/un.h> UNIX域套接字定义25. <sys/utsname.h>系统名26. lt;sys/wait.h> 进程控制POSIX标准定义的XSI扩展头⽂件(26项)1. <cpio.h> cpio归档值2. <dlfcn.h>———————-动态链接3. <fmtmsg.h> 消息显⽰结构4. <ftw.h> ⽂件树漫游5. <iconv.h> 代码集转换实⽤程序6. <langinfo.h> 语⾔信息常量7. <libgen.h> ———————-模式匹配函数定义8. <monetary.h> 货币类型9. <ndbm.h> 数据库操作10. <nl_types.h> 消息类别11. <poll.h> 轮询函数12. <search.h> 搜索表13. <strings.h>———————-字符串操作14. <syslog.h> 系统出错⽇志记录15. <ucontext.h> ⽤户上下⽂16. <ulimit.h> ⽤户限制17. <utmpx.h> ⽤户帐户数据库18. <sys/ipc.h> IPC19. <sys/msg.h>———————-消息队列20. <sys/resource.h> 资源操作21. <sys/sem.h> 信号量22. <sys/shm.h> 共享存储23. <sys/statvfs.h> ⽂件系统信息24. <sys/time.h> 时间类型25. <sys/timeb.h>———————-附加的⽇期和时间定义26. <sys/uio.h> ⽮量I/O操作POSIX标准定义的可选头⽂件(8项)1. <aio.h> 异步I/O2. <mqueue.h> ———————-消息队列3. <pthread.h> 线程4. <sched.h> 执⾏调度5. <semaphore.h> 信号量6. <spawn.h> 实时spawn接⼝7. <stropts.h> XSI STREAMS接⼝8. <trace.h> 时间跟踪1.。

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>////////////////////////////////////////////////////////////////////////// ////// #include <complex.h> //复数处理#include <fenv.h> //浮点环境#include <inttypes.h> //整数格式转换#include <stdbool.h> //布尔环境#include <stdint.h> //整型环境#include <tgmath.h> //通用类型数学宏#include<conio.h> //说明调用DOS控制台I/O子程序的各个函数。

C语言头文件使用大全

C语言头文件使用大全
//////////////////////////////////////////////////////////////////////////
标准 C++ (同上的不再注释)
#include <algorithm> //STL 通用算法 #include <bitset> //STL 位集容器 #include <cctype> #include <cerrno> #include <clocale> #include <cmath> #include <complex> //复数类 #include <cstdio> #include <cstdlib>
4
修改文件名称 rename 生成临时文件名称 tmpfile 得到临时文件路径 tmpnam 文件访问 关闭文件 fclose 刷新缓冲区 fflush 打开文件 fopen 将已存在的流指针和新文件连接 freopen 设置磁盘缓冲区 setbuf 设置磁盘缓冲区 setvbuf 格式化输入与输出函数 格式输出 fprintf 格式输入 fscanf 格式输出(控制台) printf 格式输入(控制台) scanf 格式输出到缓冲区 sprintf 从缓冲区中按格式输入 sscanf 格式化输出 vfprintf 格式化输出 vprintf 格式化输出 vsprintf 字符输入输出函数 输入一个字符 fgetc 字符串输入 fgets 字符输出 fputc 字符串输出 fputs 字符输入(控制台) getc
实用工具函数 本分类给出了一些函数无法按以上分类,但又是编程所必须要的。
头文件 stdlib.h 函数列表
  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
余弦 cos
正弦 sin
正切 tan
双曲函数 双曲余弦 cosh
双曲正弦 sinh
双曲正切 tanh
指数和对数
指数函数 exp
指数分解函数 frexp
乘积指数函数 fdexp
自然对数 log
以10为底的对数 log10
浮点数分解函数 modf
得到时间 time
时间转换函数
得到以ASCII码表示的时间 asctime
得到字符串表示的时间 ctime
得到指定格式的时间 strftime
函数库未来的发展方向
本部分用于说明各类别函数库在将来如何发展。
序号 库类别 头文件 详细说明
1 错误处理 errno.h
#include <ctype.h> //字符处理
#include <errno.h> //定义错误码
#include <float.h> //浮点数处理
#include <fstream.h> //文件输入/输出
#include <iomanip.h> //参数化输入/输出
本类别的函数用于处理不同国家的语言差异。
2 头文件 local.h
函数列表
函数类别 函数用途 详细说明
地区控制
地区设置 setlocale
数字格式约定查询
国家的货币、日期、时间等的格式转换 localeconv
数学函数
本分类给出了各种数学计算函数,必须提醒的是ANSI C标准中的数据格式并不符合IEEE754标准,一些C语言编译器却遵循IEEE754(例如frinklin C51) .
#include <stdlib.h> //定义杂项函数及内存分配函数
#include <string.h> //字符串处理
#include <strstrea.h> //基于数组的输入/输出
#include <time.h> //定义关于时间的函数
#include <wchar.h> //宽字符处理及输入/输出
2 字符处理 ctype.h
3 地区化 local.h
4 数学函数 math.h
5 信号处理 signal.h
6 输入输出 stdio.h
7 实用工具程序 stdlib.h
8 字符串处理 string.h
#include <assert.h> //设定插入点
串连接 strcat
按长度连接字符串 strncat
串比较函数 块比较 memcmp
字符串比较 strcmp
字符串比较(用于非英文字符) strcoll
按长度对字符串比较 strncmp
字符串转换 strxfrm
字符与字符串查找
字符查找 memchr
错误处理函数
错误清除 clearerr
文件结尾判断 feof
文件错误检测 ferror
得到错误提示字符串 perror
实用工具函数
本分类给出了一些函数无法按以上分类,但又是编程所必须要的。
8 头文件 stdlib.h
函数列表
函数类别 函数用途 详细说明
幂函数 幂函数 pow
平方根函数 sqrt
整数截断,绝对值和求余数函数 求下限接近整数 ceil
绝对值 fabs
求上限接近整数 floor
求余数 fmod
本分类函数用于实现在不同底函数之间直接跳转代码。
4 头文件 setjmp.h io.h
函数列表
搜索和排序工具
二分查找(数据必须已排序) bsearch
快速排序 qsort
整数运算函数
求绝对值 abs
得到除法运算底商和余数 div
求长整形底绝对值 labs
求长整形除法的商和余数 ldiv
多字节字符函数
得到多字节字符的字节数 mblen
字符查找 strchr
在串中查找指定字符集的子集的第一次出现 strcspn
字符串查找 strpbrk
在串中查找指定字符集的子集的第一次出现 strspn
在串中查找指定字符串的第一次出现 strstr
字符串分解 strtok
杂类函数
字符串设置 memset
输入一个字符 fgetc
字符串输入 fgets
字符输出 fputc
字符串输出 fputs
字符输入(控制台) getc
字符输入(控制台) getchar
字符串输入(控制台) gets
字符输出(控制台) putc
字符输出(控制台) putchar
字符串输出(控制台) puts
#include <iostream.h> //数据流输入/输出
#include <limits.h> //定义各种数据类型最值常量
#include <locale.h> //定义本地化函数
#include <math.h> //定义数学函数
#include <stdio.h> //定义输入/输出函数
输入输出函数
该分类用于处理包括文件、控制台等各种输入输出设备,各种函数以“流”的方式实现.
7 头文件 stdio.h
函数列表
函数类别 函数用途 详细说明
文件操作
删除文件 remove
修改文件名称 rename
生成临时文件名称 tmpfile
是否既不是空格,又不是字母和数字的可显示字符 ispunct
是否空格 isspace
是否大写字母 isupper
是否16进制数字(0-9,A-F)字符 isxdigit
字符大小写转换函数
转换为大写字母 toupper
转换为小写字母 tolower
地区化
可变参数处理
本类函数用于实现诸如printf,scanf等参数数量可变底函数。
6 头文件 stdarg.h
函数列表
函数类别 函数用途 详细说明
可变参数访问宏
可变参数开始宏 va_start
可变参数结束宏 va_end
访问下一个可变参数宏 va_arg
错误字符串映射 strerror
求字符串长度 strlen
日期和时间函数
本类别给出时间和日期处理函数
10 头文件 time.h
函数列表
函数类别 函数用途 详细说明
时间操作函数
得到处理器时间 clock
得到时间差 difftime
设置时间 mktime
得到多字节字符的字节数 mbtowc
多字节字符转换 wctomb
多字节字符的字符串操作
将多字节串转换为整数数组 mbstowcs
将多字节串转换为字符数组 mcstowbs
字符串处理
本分类的函数用于对字符串进行合并、比较等操作.
9 头文件 string.h
字符输出到流的头部 ungetc
直接输入输出
直接流读操作 fread
直接流写操作 fwrite
文件定位函数
得到文件位置 fgetpos
文件位置移动 fseek
文件位置设置 fsetpos
得到文件位置 ftell
文件位置复零位 remind
存储管理函数
分配存储器 calloc
释放存储器 free
存储器分配 malloc
重新分配存储器 realloc
环境通信
中止程序 abort
退出程序执行,并清除环境变量 atexit
退出程序执行 exit
读取环境参数 getenv
程序挂起,临时执行一个其他程序 system
函数类别 函数用途 详细说明
保存调用环境 setjmp
恢复调用环境 longjmp
信号处理
该分类函数用于处理那些在程序执行过程中发生例外的情况。
5 头文件 signal.h
函数列表
函数类别 函数用途 详细说明
指定信号处理函数 signal
发送信号 raise
字符串转换函数
字符串转换为整数 atoi
字符串转换为长整数 atol
字符串转换为浮点数 strtod
字符串转换为长整数 strtol
字符串转换为无符号长整型 strtoul
伪随机序列产生函数
产生随机数 rand
设置随机函数的起动数值 srand
#include <wctype.h> //宽字符分类
格式输入 fscanf
格式输出(控制台) printf
格式输入(控制台) scanf
格式输出到缓冲区 sprintf
从缓冲区中按格式输入 sscanf
格式化输出 vfprintf
格式化输出 vprintf
格式化输出 vsprintf
字符输入输出函数
1 头文件 ctype.h
函数列表<>
函数类别 函数用途 详细说明 字符测试
是否字母和数字 isalnum
是否字母 isalpha
是否控制字符 iscntrl
是否数字 isdigit
是否可显示字符(除空格外) isgraph
是否可显示字符(包括空格) isprint
相关文档
最新文档