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语言头文件ISOC标准定义的头文件(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>?XSISTREAMS接口<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>TheStandardC++libraryconsistsof51requiredheaders.Thisimplementationalsoincludesthreeaddit ionalheaders,<hash_map>,<hash_set>,and<slist>,notrequiredbytheC++Standard,foratotalof54he aders.Ofthese54headers,16constitutetheStandardTemplateLibrary,orSTL.Theseareindicatedbelo wwiththenotation<algorithm>--(STL)fordefiningnumeroustemplatesthatimplementusefulalgorithms<bitset> --fordefiningatemplateclassthatadministerssetsofbits<complex> --fordefiningatemplateclassthatsupportscomplexarithmetic<deque>--(STL)fordefiningatemplateclassthatimplementsadequecontainer<exception>--fordefiningseveralfunctionsthatcontrolexceptionhandling<fstream> --fordefiningseveraliostreamstemplateclassesthatmanipulateexteralfiles<functional>--(STL)fordefiningseveraltemplatesthathelpconstructpredicatesfor thetemplatesdefinedin<algorithm>and<numeric><hash_map>--(STL)fordefiningtemplateclassesthatimplementhashedassociativecontainers thatmapkeystovalues<hash_set>--(STL)fordefiningtemplateclassesthatimplementhashedassociativecontainers<iomanip> --fordeclaringseveraliostreamsmanipulatorsthattakeanargument<ios> --fordefiningthetemplateclassthatservesasthebaseformanyiostreamsclasses<iosfwd> --fordeclaringseveraliostreamstemplateclassesbeforetheyarenecessarilydefined<iostream> --fordeclaringtheiostreamsobjectsthatmanipulatethestandardstreams<istream> --fordefiningthetemplateclassthatperformsextractions<iterator>--(STL)fordefiningseveraltemplatesthathelpdefineandmanipulateiterators<limits> --fortestingnumerictypeproperties<list>--(STL)fordefiningatemplateclassthatimplementsadoublylinkedlistcontainer<locale> --fordefiningseveralclassesandtemplatesthatcontrollocale-specificbehavior,asintheiostreamsclasses<map>--(STL)fordefiningtemplateclassesthatimplementassociativecontainersthat mapkeystovalues<memory>--(STL)fordefiningseveraltemplatesthatallocateandfreestorageforvarious containerclasses<new> --fordeclaringseveralfunctionsthatallocateandfreestorage<numeric>--(STL)fordefiningseveraltemplatesthatimplementusefulnumericfunctions<ostream> --fordefiningthetemplateclassthatperformsinsertions<queue>--(STL)fordefiningatemplateclassthatimplementsaqueuecontainer<set>--(STL)fordefiningtemplateclassesthatimplementassociativecontainers<slist>--(STL)fordefiningatemplateclassthatimplementsasinglylinkedlistcontainer<sstream>--fordefiningseveraliostreamstemplateclassesthatmanipulatestringcontainers<stack>--(STL)fordefiningatemplateclassthatimplementsastackcontainer<stdexcept>--fordefiningseveralclassesusefulforreportingexceptions<streambuf>--fordefiningtemplateclassesthatbufferiostreamsoperations<string> --fordefiningatemplateclassthatimplementsastringcontainer<strstream>--fordefiningseveraliostreamsclassesthatmanipulatein-memorycharacter sequences<typeinfo> --fordefiningclasstype_info,theresultofthetypeidoperator<utility>--(STL)fordefiningseveraltemplatesofgeneralutility<valarray> --fordefiningseveralclassesandtemplateclassesthatsupportvalue-oriented arrays<vector>--(STL)fordefiningatemplateclassthatimplementsavectorcontainer新的C标准库<cassert> --forenforcingassertionswhenfunctionsexecute<cctype> --forclassifyingcharacters<cerrno> --fortestingerrorcodesreportedbylibraryfunctions<cfloat> --fortestingfloating-pointtypeproperties<ciso646> --forprogramminginISO646variantcharactersets<climits> --fortestingintegertypeproperties<clocale> --foradaptingtodifferentculturalconventions<cmath> --forcomputingcommonmathematicalfunctions<csetjmp> --forexecutingnonlocalgotostatements<csignal> --forcontrollingvariousexceptionalconditions<cstdarg> --foraccessingavaryingnumberofarguments<cstddef> --fordefiningseveralusefultypesandmacros<cstdio> --forperforminginputandoutput<cstdlib> --forperformingavarietyofoperations<cstring> --formanipulatingseveralkindsofstrings<ctime> --forconvertingbetweenvarioustimeanddateformats<cwchar> --formanipulatingwidestreamsandseveralkindsofstrings<cwctype> --forclassifyingwidecharacters旧的C标准库<assert.h> --forenforcingassertionswhenfunctionsexecute<ctype.h> --forclassifyingcharacters<errno.h> --fortestingerrorcodesreportedbylibraryfunctions<float.h> --fortestingfloating-pointtypeproperties<iso646.h> --forprogramminginISO646variantcharactersets<limits.h> --fortestingintegertypeproperties<locale.h> --foradaptingtodifferentculturalconventions<math.h> --forcomputingcommonmathematicalfunctions<setjmp.h> --forexecutingnonlocalgotostatements<signal.h> --forcontrollingvariousexceptionalconditions<stdarg.h> --foraccessingavaryingnumberofarguments<stddef.h> --fordefiningseveralusefultypesandmacros<stdio.h> --forperforminginputandoutput<stdlib.h> --forperformingavarietyofoperations<string.h> --formanipulatingseveralkindsofstrings<time.h> --forconvertingbetweenvarioustimeanddateformats<wchar.h> --formanipulatingwidestreamsandseveralkindsofstrings<wctype.h> --forclassifyingwidecharactersFinally,inthisimplementation,theStandardC++libraryalsoincludesseveralheadersforcompatibil itywithtraditionalC++libraries:<fstream.h>--fordefiningseveraliostreamstemplateclassesthatmanipulateexteralfiles<iomanip.h>--fordeclaringseveraliostreamsmanipulatorsthattakeanargument<iostream.h>--fordeclaringtheiostreamsobjectsthatmanipulatethestandardstreams<new.h> --fordeclaringseveralfunctionsthatallocateandfreestorage<stl.h> --fordeclaringseveraltemplateclassesthataidmigrationfromolderversions oftheStandardTemplateLibrary。

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

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标准库函数的头文件

标准库函数地头文件---------------------------------------------------------------------- 函数头文件----------------------------------------------------------------------abort stdlib.habs stdlib.h acos math.h asctime time.hasin math.h assert assert.hatan math.h atan2 math.h atexit stdlib.hatof stdlib.hatoi stdlib.hatol stdlib.h bsearch stdlib.h BUFSIZ stdio.h calloc stdlib.hceil math.h clearerr stdio.hclock time.h CLOCKS-PER-SEC time.hclock_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.hexit stdlib.h EXIT_FAILURE stdlib.h EXIT_SUCCESS stdlib.hexp math.h fabs math.h fclose stdio.hfeof stdio.h ferror stdio.hfgetc stdio.h 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 fpnntf stdio.h fputc stdio.h fputs stdio.h head stdio.h free stdlib.h freopen stdio.h frexp math.h fscanf stdio.h fseek stdio.h fsetpos stdio.h ftell stdio.h fwrite stdio.h getc stdio.h getchar stdio.h getenv stdlib.h gets stdio.h gmtime time.h HUGE-V AL math.h _IOFBF stdio.h _IOLBF stdio.h _IONBF stdio.h isalnum ctype.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.h jmp_buf setjmp.hLC_ALL locale.hLC_COLLATE locale.hLC_CTYPE locale.hLC_MONETARY locale.hLC_NUMERIC locale.hLC_TIME locale.hstruct lconv locale.hldexp math.hldiv stdlib.hldiv_t stdlib.hlocaleconv locale.hlocaltime timehlog math.hlog10 math.hlongjmp setjmp.hL_tmpnam stdio.hmalloc stdlib.hmblen stdlib.hmbstowcs stdlib.hmbtowc stdlib.hMB_CUR_MAX stdlib.hmemchr string.hmemcmp string.hmemcpy string.hmemmove string.hmemset string.hmktime time.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.hputs stdio.hqsort stdlib.hraise signal.hrand stdlib.hRAND_MAX stdlib.hremove stdio.hrename stdio.hrewind stdio.hscanf stdio.hSEEK_CUR stdio.hSEEK_END stdio.hSEEK_SET stdio.hsetbuf stdio.hsetjmp setjmp. hsetlocale locale.hsetvbuf stdio.hSIGABRT signal.hSIGFPE signal.hSIGILL signal.hSIGINT signal.hsignal signal.hSIGSEGV signal.hSIGTERM signal.hsig_atomic_t signal.hSIG_DFL signal.hSIG_ERR signal.hSIG_IGN signal.hsin math.hsinh math.hsize_t stddef.h stdlib.h string.hsprintf stdio.hsqrt math.hsrand stdlib.hsscanf stdio.hstderr stdio.hstdin stdio.hstdout stdio.hstrcat string.hstrchr string.hstrcmp string.hstrcoll string.hstrcpy string.hstrcspn string.hstrerror string.hstrftime time.hstrlen string.hstrncat string.hstrncpy string.h strpbrk string.h strrchr string.h strspn string.h strstr string.h strtod stdlib.h strtok string.h strtol stdlib.h strtoul stdlib.h strxfrm string.h system stblib.h tan math.h tanh math.h time time.h time_t time.h struct tm time.h tmpfile stdio.h tmpnam stdio.h TMP_MAX stdio.h tolower ctype.h toupper ctype.h ungetc stdio.h va_arg stdarg.h va_end stdarg.h valist stdarg.h va_ start stdarg.h vfprintf stdio.h vprintf stdio.h vsprintf stdio.h wchar_t stddef.h. wcstombs stdlib.h wctomb stdlib.h----------------------------------------------------版权申明本文部分内容,包括文字、图片、以及设计等在网上搜集整理.版权为个人所有This article includes some parts, including text, pictures, and design. Copyright is personal ownership.用户可将本文地内容或服务用于个人学习、研究或欣赏,以及其他非商业性或非盈利性用途,但同时应遵守著作权法及其他相关法律地规定,不得侵犯本网站及相关权利人地合法权利.除此以外,将本文任何内容或服务用于其他用途时,须征得本人及相关权利人地书面许可,并支付报酬.Users may use the contents or services of this article for personal study, research or appreciation, and othernon-commercial or non-profit purposes, but at the same time, they shall abide by the provisions of copyright law and other relevant laws, and shall not infringe upon the legitimate rights of this website and its relevant obligees. In addition, when any content or service of this article is used for other purposes, written permission and remuneration shall be obtained from the person concerned and the relevant obligee.转载或引用本文内容必须是以新闻性或资料性公共免费信息为使用目地地合理、善意引用,不得对本文内容原意进行曲解、修改,并自负版权等法律责任.Reproduction or quotation of the content of this article must be reasonable and good-faith citation for the use of news or informative public free information. It shall not misinterpret or modify the original intention of the content of this article, and shall bear legal liability such as copyright.。

c语言标准库函数

c语言标准库函数

c语言标准库函数C语言标准库函数。

C语言标准库函数是C语言程序设计中不可或缺的一部分,它包含了大量的函数,用于完成各种各样的任务。

这些函数可以帮助程序员简化代码,提高程序的可读性和可维护性。

本文将介绍C语言标准库函数的一些常用部分,希望能对大家有所帮助。

一、stdio.h。

stdio.h是C语言标准库中最常用的头文件之一,它包含了一系列用于输入输出的函数。

比如,printf和scanf函数分别用于输出和输入数据,而fopen和fclose函数则用于打开和关闭文件。

这些函数在日常的程序设计中经常被用到,可以说是C 语言程序设计中的基础。

二、stdlib.h。

stdlib.h是C语言标准库中包含了一些常用函数的头文件,比如malloc和free 函数用于动态内存的分配和释放,atoi和atof函数用于字符串和数字之间的转换。

这些函数在处理内存和字符串时非常有用,可以帮助程序员更加灵活地处理数据。

三、string.h。

string.h是C语言标准库中用于字符串操作的头文件,它包含了一系列用于字符串处理的函数。

比如,strcpy和strcat函数用于字符串的复制和连接,strlen函数用于获取字符串的长度,strcmp函数用于比较两个字符串的大小。

这些函数在处理字符串时非常有用,可以帮助程序员更加方便地操作字符串数据。

四、math.h。

math.h是C语言标准库中用于数学运算的头文件,它包含了一系列数学函数。

比如,sin和cos函数用于计算正弦和余弦值,sqrt函数用于计算平方根,pow函数用于计算幂。

这些函数在数学计算中非常有用,可以帮助程序员更加方便地进行数学运算。

五、time.h。

time.h是C语言标准库中用于时间操作的头文件,它包含了一系列用于时间处理的函数。

比如,time和clock函数用于获取当前时间和时钟时间,difftime函数用于计算时间差,strftime函数用于格式化时间。

这些函数在处理时间和日期时非常有用,可以帮助程序员更加方便地处理时间数据。

常用C语言标准库函数

常用C语言标准库函数

常用C语言标准库函数C语言编译系统提供了众多的预定义库函数和宏。

用户在编写程序时,可以直接调用这些库函数和宏。

这里选择了初学者常用的一些库函数,简单介绍了各函数的用法和所在的头文件。

1.测试函数Isalnum原型:int isalnum(int c)功能:测试参数c是否为字母或数字:是则返回非零;否则返回零头文件:ctype.hIsapha原型:int isapha(int c)功能:测试参数c是否为字母:是则返回非零;否则返回零头文件:ctype.hIsascii原型:int isascii(int c)功能:测试参数c是否为ASCII码(0x00~0x7F):是则返回非零;否则返回零头文件:ctype.hIscntrl原型:int iscntrl(int c)功能:测试参数c是否为控制字符(0x00~0x1F、0x7F):是则返回非零;否则返回零头文件:ctype.hIsdigit原型:int isdigit(int c)功能:测试参数c是否为数字:是则返回非零;否则返回零。

头文件:ctype.hIsgraph原型:int isgraph(int c)功能:测试参数c是否为可打印字符(0x21~0x7E):是则返回非零;否则返回零头文件:ctype.hIslower原型:int islower(int c)功能:测试参数c是否为小写字母:是则返回非零;否则返回零头文件:ctype.hIsprint原型:int isprint(int c)功能:测试参数c是否为可打印字符(含空格符0x20~0x7E):是则返回非零;否则返回零头文件:ctype.hIspunct原型:int ispunct(int c)功能:测试参数c是否为标点符号:是则返回非零;否则返回零头文件:ctype.hIsupper原型:int isupper(inr c)功能:测试参数c是否为大写字母:是则返回非零;否则返回零Isxdigit原型:int isxdigit(int c)功能:测试参数c是否为十六进制数:是则返回非零;否则返回零2.数学函数abs原型:int abs(int i)功能:返回整数型参数i的绝对值头文件:stdlib.h,math.hacos原型:double acos(double x)功能:返回双精度参数x的反余弦三角函数值头文件:math.hasin原型:double asin(double x)功能:返回双精度参数x的反正弦三角函数值头文件:math.hatan原型:double atan(double x)功能:返回双精度参数的反正切三角函数值头文件:math.hatan2原型:double atan2(double y,double x)功能:返回双精度参数y和x由式y/x所计算的反正切三角函数值头文件:math.hcabs原型:double cabs(struct complex znum)功能:返回一个双精度数,为计算出复数znum的绝对值。

C标准库函数集(头文件索引)

C标准库函数集(头文件索引)

C标准库C标准库 (1)1 输入与输出 <stdio.h> (1)2 字符类测试 <ctype.h> (19)3 字符串函数 <string.h> (22)4 数学函数 <math.h> (29)5 实用函数 <stdlib.h> (35)6 诊断 <assert.h> (43)7 变长变元表 <stdarg.h> (44)8 非局部跳转 <setjmp.h> (45)9 信号处理 <signal.h> (46)10 日期与时间函数 <time.h> (48)11 由实现定义的限制 <limits.h>和 <float.h> (52)本文包括大部分C标准库函数,但没有列出一些用途有限的函数以及某些可以简单的从其他函数合成的函数,也没有包含多字节和本地化函数。

标准库中的各个函数、类型以及宏分别在以下标准头文件中说明:1 输入与输出<stdio.h>头文件<stdio.h>定义了用于输入和输出的函数、类型和宏。

最重要的类型是用于声明文件指针的FILE。

另外两个常用的类型是size_t和fpos_t,size_t是由运算符sizeof产生的无符号整类型;fpos_t类型定义能够唯一说明文件中的每个位置的对象。

由头部定义的最有用的宏是EOF,其值代表文件的结尾。

1.1 文件操作1.1.1 fopen打开以filename所指内容为名字的文件,返回与之关联的流。

mode决定打开的方式,可选值如下:后六种方式允许对同一文件进行读和写,要注意的是,在写操作和读操作的交替过程中,必须调用fflush()或文件定位函数如fseek()、fsetpos()、rewind()等。

文件名filename的长度最大为FILENAME_MAX个字符,一次最多可打开FOPEN_MAX个文件(在<stdio.h>中定义)。

  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

c++常用函数所在头文件一览函数包含类别功能_atold math.h数学子程序把字符串转换为浮点数_beginthread process.h进程控制子程序启动执行一个新线程_bios_disk bios.h接口子程序输出BIOS磁盘驱动器服务_bios_equiplist bios.h接口子程序检查设备_bios_keybrd bios.h接口子程序直接使用BIOS的键盘接口_bios_memsize biosd.h存储子程序返回内存大小_bios_printer bios.h接口子程序直接调用BIOS服务进行打印机I/O_bios_timeofday bios.h时间和日期子程序读取或设置BIOS时钟_biosserialcom bios.h接口子程序进行串行I/O_c_exit process.h进程控制子程序不终止程序执行如同_exit的清除_cexit process.h进程控制子程序不终止程序执行如同_exit的清除_chdrive direct.h目录控制子程序设置当前驱动器_chian_intr dos.h接口子程序_chmode io.h输入输出子程序改变文件的存取权限_clear87float.h数学子程序清除浮点状态字_close io.h输入输出子程序关闭文件(3。

1)以下版本_control87float.h数学子程序处理浮点控制字_creat io.h输入输出子程序创建一个新文件或重写一个已存在的文件_disable dos.h接口子程序屏蔽中断_dos_allocmem dos.h存储子程序_dos_close dos.h输入输出子程序关闭一个文件_dos_craete dos.h输入输出子程序创建一个新文件或重写一个已存在的文件_dos_createnew dos.h输入输出子程序创建一个新文件_dos_findfirst dos.h目录控制子程序搜索一个磁盘目录_dos_findnext dos.h目录控制子程序继续_dos_findfirst的搜索_dos_freemem dos.h存储子程序_dos_getdate dos.h时间和日期子程序取得和设置系统日期_dos_getdiskfre dos.h目录控制子程序取得磁盘空闲空间_dos_getdrive dos.h目录控制子程序取得和设置当前驱动器号_dos_getfileatt dos.h输入输出子程序取得和设置文件属性_dos_getftime dos.h输入输出子程序取得和设置文件日期和时间_dos_gettime dos.h时间和日期子程序取得和设置系统时间_dos_getvect dos.h接口子程序取得中断向量_dos_keep dos.h接口子程序_dos_open dos.h输入输出子程序打开一个文件用于读和写_dos_read dos.h输入输出子程序从文件读_dos_setblock dos.h存储子程序_dos_setdate dos.h时间和日期子程序设置系统日期_dos_setdrive dos.h目录控制子程序设置当前驱动器号_dos_setfileatt dos.h输入输出子程序设置文件属性_dos_setfitme dos.h输入输出子程序设置文件时间_dos_settime dos.h时间和日期子程序设置系统时间_dos_setvect dos.h接口子程序设置中断向量_dos_write dos.h输入输出子程序写向文件_enable dos.h接口子程序开硬件中断_exit process.h进程控制子程序终止程序_fpresent float.h数学子程序重新初始化浮点数学包_fsopen stdio.h输入输出子程序_fullpath stdlib.h目录控制子程序把相对路径名转换为绝对路径名_getdcwd direct.h目录控制子程序取得指定驱动器的当前目录_getdrive direct.h目录控制子程序取得当前驱动器号_graphfreemem graphics.h图形子程序可修改的图形内存释放函数_graphgetmem graphics.h图形子程序可修改的图形内存分配函数_harderr dos.h接口子程序建立一个硬件错误处理程序_hardresume dos.h接口子程序硬件错误处理函数_hardretn dos.h接口子程序硬件错误处理函数_heapadd alloc.h添加一个块到堆上_heapmin malloc.h释放无用的堆区域_heapset malloc.h用一个常量值填充堆上的自由块_initEasyWin io.h初始化Ease windows_lrotl stdlib.h数学子程序将无符号长整型数向左循环移位_lrotr stdlib.h数学子程序将无符号长整型数向右循环移位_makeepath stdlib.h目录控制子程序生成一个路径_matherrl math.h诊断子程序用户可修改的数学错误处理程序_matherrl math.h数学子程序用户可修改的数学错误处理程序_open io.h输入输出子程序打开一个文件进行读和写_OvrInitEms dos.h初始化复盖管理程序用于交换EMS内存_OvrInitExt dos.h初始化复盖管理程序用于交换EXT内存_pclose stdio.h等待一个管道命令结束_popen stdio.h创建一个子命令处理程序管道_read io.h输入输出子程序读文件(3。

1以下版本)_rotl stdlib.h嵌入子程序将一个无符号整数左循环移位_rotl stdlib.h数学子程序把一个无符号整数左循环移位_rotr stdlib.h嵌入子程序将一个无符号整数向左循环移位_searchstr stdlib.h为某文件查找某些目录_setcursortype graphics.h图形子程序选择光标类型_setcursortype conio.h输入输出子程序选择光标类型_setcursortype conio.h文本窗口显示子程选择光标类型_splitpath stdlib.h目录控制子程序将一个全限定的路径名分解各个成份_status87float.h数学子程序取浮点状态_strdate stdlib.h转换子程序把当前日期转换成字符串_strerror string.h stdio输入输出子程序建立用户定义的错误信息_strtime stdlib.h转换子程序转换当前日期为字符串_strtold stdlib.h转换子程序_strtold stdlib.h数学子程序_tolower ctype.h转换子程序把字符转换成小写字母_write io.h输入输出子程序写文件abort process.h进程控制子程序异常终止一进程abs stdlib.h compl数学子程序返回整数的绝对值absl math.h数学子程序计算复数的模absread dos.h接口子程序读磁盘的绝对扇区abswrite dos.h接口子程序写磁盘的绝对扇区access io.h输入输出子程序确定文件的存取权限acos math.h complex数学子程序计算反余弦值acosl math.h数学子程序计算反余弦值alloca malloc.h存储子程序分配临时堆栈空间allocm dos.h存储子程序分配DOS内存arc graphics.h图形子程序画园弧arg complex.h数学子程序求复平面中一个复数的弧度asctime time.h时间和日期子程序转换日期和时间为对应的ASCII码asin math.h complex数学子程序反正弦函数asinl math.h数学子程序反正弦函数assert assert.h诊断子程序条件终止函数atan2math.h complex数学子程序计算y/x的反正切值atan2l math.h数学子程序计算y/x的反正切值atof stdlib.h转换子程序将字符串转换为浮点数atof math.h stdlib.数学子程序将字符串转换成浮点数atoi stdlib.h转换子程序将字符串转换为整数atoi stdlib.h数学子程序把字符串转换成整型数atol stdlib.h转换子程序将字衔串转换成长整型数atol stdlib.h数学子程序抬字符串转换为长整型bar graphics.h图形子程序画二维条形图bar3d graphics.h图形子程序画一个三维条形图bcd bcd.h数学子程序把一个数转换为相对应的BCD码bdos dos.h接口子程序DOS系统调用bdosptr dos.h接口子程序DOS系统调用bioscom bios.h接口子程序I/O通讯biosdisk bios.h接口子程序调用BIOS磁盘驱动程序bioseqiplist bios.h接口子程序检查设备bioskey bios.h接口子程序调用BIOS的键盘接口biosmemory bios.h接口子程序返加内存的大小biosprintf bios.h接口子程序调用BIOS的打印I/O接口biostime bios.h接口子程序读取或设置BIOS时钟brk alloc.h存储子程序改变数据段内存分配cabs math.h数学子程序计算复数的模calloc alloc.h stdlib存储子程序分配内存ceil math.h数学子程序舍入ceill math.h数学子程序舍入cgets conio.h输入输出子程序读字符串chdir dir.h目录控制子程序改变当前目录chmod io.h输入输出子程序改变文件存取权限chsize io.h输入输出子程序修改文件长度circle graphics.h图形子程序画园cleardevice graphics.h图形子程序清图形屏幕clearerr io.h输入输出子程序复位错误标志close io.h输入输出子程序关闭文件closedir direct.h目录控制子程序关闭目录流closegraph graphics.h图形子程序关闭图形系统clreol conio.h文本窗口显示子程清除从当前光标位置到行尾的字符clrscr conio.h文本窗口显示子程清除文本窗口,并把光标放在左上角complex complex.h数学子程序创建复数conj complex.h数学子程序求复数的共轭复数coreleft alloc.h stdlib存储子程序返顺未使用的内存大小cos math.h complex数学子程序计算余弦值cosh math.h complex数学子程序计算双曲余弦值coshl math.h数学子程序计算双曲余弦值cosl math.h数学子程序计算余弦值country dos.h接口子程序读取与特定国家有关的格式cprintf conio.h输入输出子程序格式化并输出数据到屏幕cputs conio.h输入输出子程序输出一字符串到屏幕creat io.h输入输出子程序创建一个新文件或重写一个已存在的文件creatnew io.h输入输出子程序创建新文件creattemp io.h输入输出子程序创建一个文件名唯一的文件cscanf conio.h输入输出子程序从控制台执行格式化输入ctime time.h时间和日期子程序把日期和时间转化为对应的字符串ctrlbrk dos.h接口子程序设置CTRL-BREAK处理程序delay dos.h杂类子程序暂停DOSdelline conio.h文本窗口显示子程在文本窗口中删去一行difftime time.h时间和日期子程序计算二个时刻的时间差disable dos.h接口子程序屏蔽中断div math.h数学子程序将二个整数相除,返回商和余数dosexterr dos.h接口子程序获取扩展错误信息dostounix dos.h时间和日期子程序把日期和时间转换成UNIX格式drawpoly graphics.h图形子程序绘制多边形dup io.h输入输出子程序复制文件句柄dup2io.h输入输出子程序将一个文件句柄复制到一个已有的文件句柄ecvt stdlib.h转换子程序把浮点数转换成字符串ecvt stdlib.h数学子程序把浮点数转换为字符串elipse graphics.h图形子程序绘制椭园enable dos.h接口子程序开硬件中断eof io.h输入输出子程序检测文件是否结束execle process.h进程控制子程序装入并运行其它程序execlp process.h进程控制子程序装入并运行其它程序execlpe process.h进程控制子程序装入并运行其它程序exect process.h进程控制子程序execv process.h进程控制子程序装入并运行其它程序。

相关文档
最新文档