最為C與C的頭文件大全_第1頁(yè)
最為C與C的頭文件大全_第2頁(yè)
最為C與C的頭文件大全_第3頁(yè)
最為C與C的頭文件大全_第4頁(yè)
最為C與C的頭文件大全_第5頁(yè)
已閱讀5頁(yè),還剩44頁(yè)未讀, 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(quán)說(shuō)明:本文檔由用戶(hù)提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡(jiǎn)介

最為完整C與C++的頭文件大全

C/C++頭文件一覽

C、傳統(tǒng)C++

#include<assert.h>〃設(shè)定插入點(diǎn)#include<ctype.h>〃字符處理#include

<errno.h>〃定義錯(cuò)誤碼ttinclude<float.h>〃浮點(diǎn)數(shù)處理

ttinclude<fstream.h>//文件輸入/輸出ttinclude<iomanip.h>〃參數(shù)化輸入/輸

出#include<iostream.h>〃數(shù)據(jù)流輸入/輸出

#include<limits.h>//定義各種數(shù)據(jù)類(lèi)型最值常量ttinclude<locale.h>〃定義本

地化函數(shù)/include<math.h>〃定義數(shù)學(xué)函數(shù)

ttinclude<stdio.h>〃定義輸入/輸出函數(shù)

ttinclude<stdlib.h>//定義雜項(xiàng)函數(shù)及內(nèi)存分配函數(shù)ttinclude<string.h>〃字符

串處理

ttinclude<strstrea.h>〃基于數(shù)組的輸入/輸出#include<time.h>//定義關(guān)于時(shí)

間的函數(shù)

ttinclude<wchar.h>〃寬字符處理及輸入/輸出ttinclude<wctype.h>〃寬字符分類(lèi)

標(biāo)準(zhǔn)C語(yǔ)言頭文件

ISOC標(biāo)準(zhǔn)定義的頭文件(24項(xiàng))<assert.h>驗(yàn)證程序斷言<errno.h>出錯(cuò)碼

<complex.h>支持復(fù)數(shù)算術(shù)運(yùn)算

<fenv.h>浮點(diǎn)環(huán)境

<ctype.h>字符類(lèi)型

<float.h>浮點(diǎn)常量<limits.h>實(shí)現(xiàn)常量

<inttypes.h>整型格式轉(zhuǎn)換<locale.h>局部類(lèi)別<signal.h>信號(hào)

<iso646.h>替代關(guān)系操作符宏

<math.h>數(shù)學(xué)常量

<setjmp.h>非局部goto

<stdbool.h>布爾類(lèi)型和值

<stdarg.h>可變參數(shù)表

<stddef.h>標(biāo)準(zhǔn)定義<stdint.h>整型

<stdio.h>標(biāo)準(zhǔn)I/O庫(kù)

<tgmath.h>通用類(lèi)型數(shù)學(xué)宏

<stdlib.h>實(shí)用程序庫(kù)函數(shù)<time.h>時(shí)間和日期

<string.h>字符串操作

<wchar.h>寬字符支持<wctype.h>寬字符分類(lèi)和映射支持

POSIX標(biāo)準(zhǔn)定義的必須的頭文件(26項(xiàng))<dirent.h>目錄項(xiàng)

<fcntl.h>文件控制

<fnmatch.h>文件名匹配類(lèi)型<netdb.h>網(wǎng)絡(luò)數(shù)據(jù)庫(kù)操作

<tar.h>tar歸檔值<utime.h>文件時(shí)間

<glob.h>路徑名模式匹配類(lèi)型<grp.h>組文件<pwd.h>口令文件

<regex.h>正則表達(dá)式<unistd.h>符號(hào)常量

<termios.h>終端I/O

<wordexp.h>字?jǐn)U展類(lèi)型<arpa/inet.h>Internet定義<net/if.h>套接字本地接口

<netinet/in.h>Internet地址族<netinet/top.h>傳輸控制協(xié)議<sys/mman.h>內(nèi)存

管理聲明<sys/select.h>select函數(shù)<sys/socket.h>套接字接口<sys/times.h>進(jìn)

程時(shí)間<sys/utsname.h》系統(tǒng)名

<sys/stat.h>文件狀態(tài)<sys/un.h>UNIX域套接字定義

<sys/types.h>基本系統(tǒng)數(shù)據(jù)類(lèi)型<sys/wait.h>進(jìn)程控制

POSIX標(biāo)準(zhǔn)定義的XSI擴(kuò)展頭文件(26項(xiàng))<cpio.h>cpio歸檔值

<dlfcn.h>動(dòng)態(tài)鏈接

<fmtmsg.h>消息顯示結(jié)構(gòu)<ftw.h>文件樹(shù)漫游〈iconv.h>代碼集轉(zhuǎn)換實(shí)用程序

<langinfo.h>語(yǔ)言信息常量<ndbm.h>數(shù)據(jù)庫(kù)操作<search.h>搜索表<ucontext.h>

用戶(hù)上下文<sys/ipc.h>IPC

<sys/sem.h>信號(hào)量<sys/time.h>時(shí)間類(lèi)型

<libgen.h>模式匹配函數(shù)定義<monetary.h>貨幣類(lèi)型<nltypes.h>消息類(lèi)別

<strings.h>字符串操作<ulimit.h>用戶(hù)限制<sys/msg.h>消息隊(duì)列<sys/shm.h>共

享存儲(chǔ)

<poll.h>輪詢(xún)函數(shù)

<syslog.h>系統(tǒng)出錯(cuò)日志記錄<utmpx.h>用戶(hù)帳戶(hù)數(shù)據(jù)庫(kù)

<sys/resource.h>資源操作

<sys/statvfs.h>文件系統(tǒng)信息<sys/timeb.h>附加的時(shí)間<sys/uio.h>矢量I/O操

POSIX標(biāo)準(zhǔn)定義的可選頭文件(8項(xiàng))<aio.h>異步I/O

<mqueue.h>消息隊(duì)列

<sched.h>執(zhí)行調(diào)度

<semaphore.h>信號(hào)量

<stropts.h>XSISTREAMS接口

<trace.h>時(shí)間跟蹤

<pthread.h>線(xiàn)程

<spawn.h>實(shí)時(shí)spawn接口標(biāo)準(zhǔn)C++語(yǔ)言頭文件(54個(gè)其中16個(gè)用于構(gòu)建STL,3個(gè)為

附加非必須)

<algorithm>STL通用算法<cctype>字符處理

<bitset>STL位集容器<cerrno>錯(cuò)誤碼

<cassert>用于在程序運(yùn)行時(shí)執(zhí)行斷言<cfloat>用于測(cè)試浮點(diǎn)類(lèi)型屬性

<ciso646>IS0646變體字符集<climits>測(cè)試整數(shù)類(lèi)型屬性<cmath>

數(shù)學(xué)函數(shù)

<complex>復(fù)數(shù)類(lèi)

<clocale>本地化函數(shù)

<csetjmp>執(zhí)行非內(nèi)部的goto語(yǔ)句

<csignal>信號(hào)<cstdarg>訪(fǎng)問(wèn)參數(shù)數(shù)量變化的函數(shù)<cstdlib>雜項(xiàng)函數(shù)及內(nèi)存分配

<cstddef>用于定義實(shí)用的類(lèi)型和宏<cstring>字符串

<cwctype>寬字符分類(lèi)

<cstdio>輸入/輸出<ctime>

時(shí)間

<cwchar>寬字符處理及輸入/輸出

<deque>STL雙端隊(duì)列容器<functional>STL函數(shù)對(duì)象

<exception>異常處理類(lèi)

<fstream>文件流

<iomanip>參數(shù)化輸入/輸出<iostream>數(shù)據(jù)流輸入/輸出

<ios>基本輸入/輸出支持<istream>基本輸入流

<iosfwd>輸入/輸出前置聲明<iterator>遍歷序列的類(lèi)<locale>國(guó)際化支持

<limits>各種數(shù)據(jù)類(lèi)型最值常量<map>STL映射容器

<list>STL線(xiàn)性列表容器<memory>專(zhuān)用內(nèi)存分配器<o(jì)stream>基本輸出流

<sstream>基于字符串的流

<streambuf>iostream的緩沖區(qū)類(lèi)

<new>基本內(nèi)存分配和釋放<queue>

STL隊(duì)列容器

<numeric>通用的數(shù)字操作

<set>STL集合容器

<stack>STL堆棧容器<string>字符串類(lèi)

<stdexcept>標(biāo)準(zhǔn)異常類(lèi)

<strstream>非內(nèi)存字符序列的流類(lèi)<typeinfo>運(yùn)行時(shí)類(lèi)型標(biāo)識(shí)<valarray>支持值

數(shù)組的類(lèi)和模版類(lèi)<vector>STL動(dòng)態(tài)數(shù)組容器

<utility>STL通用模板類(lèi)

標(biāo)準(zhǔn)C++附加的頭文件(3個(gè))非必須

<hashmap>

<hashset>

<slist>TheStandardC++libraryconsistsof51requiredheaders.This

implementationalsoincludesthreeadditional

headers,<hash_map>,<hash_set>,and<slist>,notrequiredbytheC++Standard,

foratotalof54headers.Ofthese54headers,16constitutetheStandard

TemplateLibrary,orSTL.Theseareindicatedbelowwiththenotation

<algorithm>--(STL)fordefiningnumeroustemplatesthatimplementuseful

algorithms

<bitset>--fordefiningatemplateclassthatadministerssetsofbits

<complex>一-fordefiningatemplateclassthatsupportscomplexarithmetic

<deque>—(STL)fordefiningatemplateclassthatimplementsadeque

container

<exception>-fordefiningseveralfunctionsthatcontrolexception

handling

<fstream>-fordefiningseveraliostreamstemplateclassesthatmanipulate

exteralfiles<functional>--(STL)fordefiningseveraltemplatesthathelp

constructpredicatesforthetemplatesdefinedin<algorithm>and<numeric>

<hash_map>

<hash_set>

<ios>--(STL)fordefiningtemplateclassesthatimplementhashed

associativecontainers--(STL)fordefiningtemplateclassesthatimplement

hashedassociativecontainersthatmapkeystovalues<iomanip>一for

declaringseveraliostreamsmanipulatorsthattakeanargument-一fordefining

thetemplateclassthatservesasthebaseformanyiostreamsclasses<iosfwd>

-一fordeclaringseveraliostreamstemplateclassesbeforetheyare

necessarilydefined

<iostream>

<iterator>

<list>-fordeclaringtheiostreamsobjectsthatmanipulatethestandard

streams-(STL)fordefiningseveraltemplatesthathelpdefineand

manipulateiterators-(STL)fordefiningatemplateclassthatimplementsa

doublylinkedlistcontainer<istream>-fordefiningthetemplateclassthat

performsextractions<limits>-fortestingnumerictypeproperties<locale>

-fordefiningseveralclassesandtemplatesthatcontrol

locale-specificbehavior,asintheiostreamsclasses

<map>--(STL)fordefiningtemplateclassesthatimplementassociative

containersthatmapkeystovalues

<memory>--(STL)fordefiningseveraltemplatesthatallocateandfree

storageforvariouscontainerclasses

<new>-fordeclaringseveralfunctionsthatallocateandfreestorage

<numeric>--(STL)fordefiningseveraltemplatesthatimplementuseful

numericfunctions<ostream>-fordefiningthetemplateclassthatperforms

insertions

<queue>—(STL)fordefiningatemplateclassthatimplementsaqueue

container

<set>--(STL)fordefiningtemplateclassesthatimplementassociative

containers

<slist>--(STL)fordefiningatemplateclassthatimplementsasingly

linkedlistcontainer<sstream>--fordefiningseveraliostreamstemplate

classesthatmanipulatestringcontainers<stack>--(STL)fordefininga

templateclassthatimplementsastackcontainer

<stdexcept>-fordefiningseveralclassesusefulforreportingexceptions

<streambuf>-fordefiningtemplateclassesthatbufferiostreams

operations

<string>--fordefiningatemplateclassthatimplementsastringcontainer

<strstream>—fordefiningseveraliostreamsclassesthatmanipulatein-

memorycharactersequences

-fordefiningclasstypeinfo,theresultofthetypeidoperator

--fordefiningseveralclassesandtemplateclassesthatsupportvalue-

oriented<typeinfo><valarray>

<utility>--(STL)fordefiningseveraltemplatesofgeneralutilityarrays

<vector>--(STL)fordefiningatemplateclassthatimplementsavector

container新的C標(biāo)準(zhǔn)庫(kù)

<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標(biāo)準(zhǔn)庫(kù)

<assert.h>--forenforcingassertionswhenfunctionsexecute

<ctype.h>-forclassifyingcharacters

<errno.h>一fortestingerrorcodesreportedbylibraryfunctions

<float.h>-fortestingfloating-pointtypeproperties

<iso646.h>

<limits.h>

<locale.h>

<setjmp.h>

<signal.h>

<stdarg.h>

<stddef.h>

<stdlib.h>

<string.h>一forprogramminginISO646variantcharactersets一-for

testingintegertypeproperties-一foradaptingtodifferentcultural

conventions--forexecutingnonlocalgotostatements--forcontrolling

variousexceptionalconditions-foraccessingavaryingnumberofarguments

-fordefiningseveralusefultypesandmacros-forperformingavarietyof

operations-formanipulatingseveralkindsofstrings<math.h>-for

computingcommonmathematicalfunctions<stdio.h>-forperforminginputand

output

<time.h>—forconvertingbetweenvarioustimeanddateformats

<wchar.h>一一formanipulatingwidestreamsandseveralkindsofstrings

<wctype.h>

Finally,inthisimplementation,theStandardC++libraryalsoincludes

severalheadersforcompatibilitywithtraditionalC++libraries:

<fstream.h>-fordefiningseveraliostreamstemplateclassesthat

manipulateexteralfiles<iomanip.h>-fordeclaringseveraliostreams

manipulatorsthattakeanargument

<iostream.h>—fordeclaringtheiostreamsobjectsthatmanipulatethe

standardstreams<new.h>-fordeclaringseveralfunctionsthatallocateand

freestorage

<stl.h>一-fordeclaringseveraltemplateclassesthataidmigrationfrom

olderversionsoftheStandardTemplateLibrary-forclassifyingwide

characters

//////////////////////////////////////////////////////////////////////////

標(biāo)準(zhǔn)C++(同上的不再注釋?zhuān)?include<algorithm>//STL通用算法

#include<bitset>//STL位集容器

ttinclude<cctype>

ttinclude<cerrno>

^include<clocale>

#include<cmath>

#include<complex>〃復(fù)數(shù)類(lèi)

#include<cstdio>

ttinclude<cstdlib>

itinclude<cstring>

Sinclude<ctime>

ttinclude<deque>//STL雙端隊(duì)列容器

#include<exception>〃異常處理類(lèi)

ttinclude<fstream>

itinclude<functional>//STL定義運(yùn)算函數(shù)(代替運(yùn)算符)

#include<limits>

itinclude<list>//STL線(xiàn)性列表容器

#include<map>//STL映射容器

ttinclude<iomanip>

ttinclude<ios>//基本輸入/輸出支持

itinclude<iosfwd>〃輸入/輸出系統(tǒng)使用的前置聲明

ttinclude<iostream>

#include<istream>〃基本輸入流

ttinclude<ostream>〃基本輸出流

#include<queue>//STL隊(duì)列容器

ttinclude<set>//STL集合容器

ttinclude<sstream>〃基于字符串的流

ttinclude<stack>//STL堆棧容器

#include<stdexcept>〃標(biāo)準(zhǔn)異常類(lèi)

#include<strcambuf>〃底層輸入/輸出支持

ftinclude<string>〃字符串類(lèi)

ttinclude<utility>//STL通用模板類(lèi)

ftinclude<vector>//STL動(dòng)態(tài)數(shù)組容器

ttinclude<cwchar>

#include<cwctype>

usingnamespacestd;

//////////////////////////////////////////////////////////////////////////

C99增加

Jtinclude<complex.h>//復(fù)數(shù)處理

ttinclude<fenv.h>〃浮點(diǎn)環(huán)境

#include<inttypes.h>〃整數(shù)格式轉(zhuǎn)換

ttinclude<stdbool.h>〃布爾環(huán)境

ttinclude<stdint.h>//整型環(huán)境

ttinclude<tgmath.h>〃通用類(lèi)型數(shù)學(xué)宏

C頭文件大全

--------------------------------------------------------------------分類(lèi)函數(shù),所在

函數(shù)庫(kù)為ctype.h

intisalpha(intch)若ch是字母('A'Z','a'z')返回非0值,否則返回0

intisalnum(intch)若ch是字母(‘A',Z','a'z')或數(shù)字('O'9')返回非0值,

否則返回0

intisascii(intch)若ch是字符(ASCII碼中的0T27)返回非0值,否則返回Oint

iscntrl(intch)若ch是作廢字符(0x7F)或普通控制字符(OxOO-OxIF)返回非0值,否則

返回0

intisdigit(intch)若ch是數(shù)字CO'9')返回非0值,否則返回0

intisgraph(intch)若ch是可打印字符(不含空格)(0x21-0x7E)返回非0值,否則返

回0

intislower(intch)若ch是小寫(xiě)字母('a'z')返回非0值,否則返回0

intisprint(intch)若ch是可打印字符(含空格)(0x20-0x7E)返回非0值,否則返回0

intispunct(intch)若ch是標(biāo)點(diǎn)字符(OxOO-OxlF)返回非0值,否則返回0

intisspace(intch)若ch是空格('’),水平制表符('\t'),回車(chē)符('\r'),走紙換行

('\f'),垂直制表符('\v'),換行符('\n')返回非0值,否則返回0

intisupper(intch)若ch是大寫(xiě)字母(‘A'」Z')返回非0值,否則返回0

intisxdigit(intch)若ch是16進(jìn)制數(shù)('0'-'9,"'-'卜,"'-'£')返回非0值,否

則返回0

inttolower(intch)若ch是大寫(xiě)字母(‘A'」Z')返回相應(yīng)的小寫(xiě)字母('a'z')

inttoupper(intch)若ch是小寫(xiě)字母('a'-'z')返回相應(yīng)的大寫(xiě)字母('A'-'Z')

--------------------------------------------------------------------數(shù)學(xué)函數(shù),所在

函數(shù)庫(kù)為math,h、stdlib.h>string.h>float,h

intabs(inti)返回整型參數(shù)i的絕對(duì)值

doublecabs(structcomplexznum)返回復(fù)數(shù)znum的絕對(duì)值

doublefabs(doublex)返回雙精度參數(shù)x的絕對(duì)值

longlabs(longn)返回長(zhǎng)整型參數(shù)n的絕對(duì)值

doubleexp(doublex)返回指數(shù)函數(shù)ex的值

doublefrexp(doublevalue,int*eptr)返回value=x*2n中x的值,n存貯在eptr中

doubleIdexp(doublevalue,intexp);返回value*2exp的值

doublelog(doublex)返回logex的值

doubleloglO(doublex)返回loglOx的值

doublepow(doublex,doubley)返回xy的值

doublepowlO(intp)返回lOp的值

doublesqrt(doublex)返回+Jx的值

doubleacos(doublex)返回x的反余弦cosT(x)值,x為弧度

doubleasin(doublex)返回x的反正弦sinT(x)值,x為弧度

doubleatan(doublex)返回x的反正切tan-l(x)值,x為弧度

doubleatan2(doubley,doublex)返回y/x的反正切tanT(x)值,y的x為弧度

doublecos(doublex)返回x的余弦cos(x)值,x為弧度

doublesin(doublex)返回x的正弦sin(x)值,x為弧度

doubletan(doublex)返回x的正切tan(x)值,x為弧度

doublecosh(doublex)返回x的雙曲余弦cosh(x)值,x為弧度

doublesinh(doublex)返回x的雙曲正弦sinh(x)值,x為弧度

doubletanh(doublex)返回x的雙曲正切tanh(x)值,x為弧度

doublehypot(doublex,doubley)返回直角三角形斜邊的長(zhǎng)度(z),x和y為直角邊的

長(zhǎng)度,z2=x2+y2doubleceil(doublex)返回不小于x的最小整數(shù)

doublefloor(doublex)返回不大于x的最大整數(shù)

voidsrand(unsignedseed)初始化隨機(jī)數(shù)發(fā)生器

intrand()產(chǎn)生一個(gè)隨機(jī)數(shù)并返回這個(gè)數(shù)

doublepoly(doublex,intn,doublec[])從參數(shù)產(chǎn)生一個(gè)多項(xiàng)式

doublemodf(doublevalue,double*iptr)將雙精度數(shù)value分解成尾數(shù)和階

doublefmod(doublex,doubley)返回x/y的余數(shù)

doublefrexp(doublevalue,int*eptr)將雙精度數(shù)value分成尾數(shù)和階

doubleatof(char*nptr)將字符串nptr轉(zhuǎn)換成浮點(diǎn)數(shù)并返回這個(gè)浮點(diǎn)數(shù)

doubleatoi(char*nptr)將字符串nptr轉(zhuǎn)換成整數(shù)并返回這個(gè)整數(shù)

doubleatol(char*nptr)將字符串nptr轉(zhuǎn)換成長(zhǎng)整數(shù)并返回這個(gè)整數(shù)

char*ecvt(doublevalue,intndigit,int*decpt,int*sign)將浮點(diǎn)數(shù)value轉(zhuǎn)換

成字符串并返回該字符串char*fcvt(doublevalue,intndigit,int*decpt,int*sign)

將浮點(diǎn)數(shù)value轉(zhuǎn)換成字符串并返回該字符串

char*gcvt(doublevalue,intndigit,char*buf)將數(shù)value轉(zhuǎn)換成字符串并存于

buf中,并返回buf的指針

char*ultoa(unsignedlongvalue,char*string,intradix)將無(wú)符號(hào)整型數(shù)value

轉(zhuǎn)換成字符串并返回該字符串,radix為轉(zhuǎn)換時(shí)所用基數(shù)

char*ltoa(longvalue,char*string,intradix)將長(zhǎng)整型數(shù)value轉(zhuǎn)換成字符串并

返回該字符串,radix為轉(zhuǎn)換時(shí)所用基數(shù)

char*itoa(intvalue,char*string,intradix)將整數(shù)value轉(zhuǎn)換成字符串存入

string,radix為轉(zhuǎn)換時(shí)所用基數(shù)doubleatof(char*nptr)將字符串nptr轉(zhuǎn)換成雙精度

數(shù),并返回這個(gè)數(shù),錯(cuò)誤返回0

intatoi(char*nptr)將字符串nptr轉(zhuǎn)換成整型數(shù),并返回這個(gè)數(shù),錯(cuò)誤返回0

longatol(char*nptr)將字符串nptr轉(zhuǎn)換成長(zhǎng)整型數(shù),并返回這個(gè)數(shù),錯(cuò)誤返回0

doublestrtod(char*str,char**endptr)將字符串str轉(zhuǎn)換成雙精度數(shù),并返回這個(gè)

數(shù),

longstrtol(char*str,char**endptr,intbase)將字符串str轉(zhuǎn)換成長(zhǎng)整型數(shù),并

返回這個(gè)數(shù),

intmatherr(structexception*e)用戶(hù)修改數(shù)學(xué)錯(cuò)誤返回信息函數(shù)(沒(méi)有必要使用)

double_matherr(_mexcepwhy,char*fun,double*arglp,double*arg2p,double

retval)由戶(hù)修改數(shù)殺錯(cuò)誤返回信息函數(shù)(沒(méi)有必要使用)

unsignedint_clear87()清除浮點(diǎn)狀態(tài)字并返回原來(lái)的浮點(diǎn)狀態(tài)

void_fpreset()重新初使化浮點(diǎn)數(shù)學(xué)程序包

unsignedint_status87()返回浮點(diǎn)狀態(tài)字

■目錄函數(shù),所在

函數(shù)庫(kù)為dir.h、dos.h

intchdir(char*path)使指定的目錄path(如:"C:\\WPS〃)變成當(dāng)前的工作目錄,成

功返回0

intfindfirst(char*pathname,structffblk*ffblk,intattrib)查找指定的文件,

成功返回0

pathname為指定的目錄名和文件名,如〃C:\\WPS\\TX丁

ffblk為指定的保存文件信息的一個(gè)結(jié)構(gòu),定義如下:

structffblk

charff_reserved[21];|

charff_attrib;|

intff_ftime;|

intff_fdate;|

longfffsize;|

charff_name[13];|

attrib為文件屬性,由以下字符代表

IFA_RDONLY只讀文件|FA_LABEL卷標(biāo)號(hào)|

IFA_HIDDEN隱藏文件|FADIREC目錄|

IFA_SYSTEM系統(tǒng)文件|FA_ARCH檔案|

例:

structffblkff;

findfirst(〃awps〃,&ff,FA_RDONLY);

intfindnext(structffblk*ffblk)取匹配finddirst的文件,成功返回0

voidfumerge(char*path,char*drive,char*dir,char*name,char*ext)

此函數(shù)通過(guò)盤(pán)符drive(C:、A:等),路徑dir(\TC、\BC\LIB等),

文件名name(TC、WPS等),擴(kuò)展名ext(.EXE、.COM等)組成一個(gè)文件名存與path中.

intfnsplit(char*path,char*drive,char*dir,char*name,char*ext)

此函數(shù)將文件名path分解成盤(pán)符drive(C:、A:等),路徑dir(\TC、\BC\LIB等),

文件名name(TC、WPS等),擴(kuò)展名ext(.EXE、.COM等),并分別存入相應(yīng)的變量中.

intgetcurdir(intdrive,char*direc)此函數(shù)返回指定驅(qū)動(dòng)器的當(dāng)前工作目錄名稱(chēng)

drive指定的驅(qū)動(dòng)器(0=當(dāng)前,1=A,2=B,3=C等)

direc保存指定驅(qū)動(dòng)器當(dāng)前工作路徑的變量成功返回0

char*getcwd(char*buf,iintn)此函數(shù)取當(dāng)前工作目錄并存入buf中,直到n個(gè)字

節(jié)長(zhǎng)為為止.錯(cuò)誤返回NULL

intgetdiskO取當(dāng)前正在使用的驅(qū)動(dòng)器,返回一個(gè)整數(shù)(0=A,l=B,2=C等)

intsetdisk(intdrive)設(shè)置要使用的驅(qū)動(dòng)器drive(0=A,1=B,2=C等),

返回可使用驅(qū)動(dòng)器總數(shù)

intmkdir(char*pathname)建立一個(gè)新的目錄pathname,成功返回0

intrmdir(char*pathname)刪除一個(gè)目錄pathname,成功返回0

char*mktemp(char*template)構(gòu)造一■個(gè)當(dāng)前目錄上沒(méi)有的文件名并存于template中

char*searchpath(char*pathname)利用MSDOS找出文件filename所在路徑,

,此函數(shù)使用DOS的PATH變量,未找到文件返回NULL

--------------------------------------------------------------------進(jìn)程函數(shù),所在

函數(shù)庫(kù)為stdlib.h、process,h

voidabort()此函數(shù)通過(guò)調(diào)用具有出口代碼3的_exit寫(xiě)一個(gè)終止信息于stdc門(mén)

并異常終止程序。無(wú)返回值

intexec…裝入和運(yùn)行其它程序

intexecl(char*pathname,char*argO,char*argl,char*argn,NULL)

intexecle(char*pathname,char*argO,char*argl,char*argn,NULL,char

*envp[])

intexeclp(char*pathname,char*argO,char*argl,?,,,NULL)

intexeclpe(char*pathname,char*argO,char*argl,NULL,char*envp[])

intexecv(char*pathname,char*argv[])

intexecve(char*pathname,char*argv[],char*envp[])

intexecvp(char*pathname,char*argv[])

intexecvpe(char*pathname,char*argv[],char*envp口)

exec函數(shù)族裝入并運(yùn)行程序pathname,并將參數(shù)

argO(argl,arg2,argv[],envp口)傳遞給子程序,出錯(cuò)返回T

在exec函數(shù)族中,后綴1、v、p、e添加到exec后,

所指定的函數(shù)將具有某種操作能力

有后綴P時(shí),函數(shù)可以利用DOS的PATH變量查找子程序文件。

1時(shí),函數(shù)中被傳遞的參數(shù)個(gè)數(shù)固定。

v時(shí);函數(shù)中被傳遞的參數(shù)個(gè)數(shù)不固定。

e時(shí),函數(shù)傳遞指定參數(shù)envp,允許改變子進(jìn)程的環(huán)境,

無(wú)后綴e時(shí)、子進(jìn)程使用當(dāng)前程序的環(huán)境。

void_exit(intstatus)終止當(dāng)前程序,但不清理現(xiàn)場(chǎng)

voidexit(intstatus)終止當(dāng)前程序,關(guān)閉所有文件,寫(xiě)緩沖區(qū)的輸出(等待輸出),

并調(diào)用任何寄存器的〃出口函數(shù)〃,無(wú)返回值

intspawn…運(yùn)行子程序

intspawn1(intmode,char*pathname,char*argO,char*argl,char*argn,NULL)

intspawnle(intmode,char*pathname,char*argO,char*argl,???,char

*argn,NULL,char*envp口)

intspawnIp(intmode,char*pathname,char*argO,char*argl,char

*argn,NULL)

intspawnlpe(intmode,char*pathname,char*argO,char*argl,,,,,char

*argn,NULL,char*envp[])intspawnv(intmode,char*pathname,char*argv[])

intspawnve(intmode,char*pathname,char*argv[],char*envp[])

intspawnvp(intmode,char*pathname,char*argv口)

intspawnvpe(intmode,char*pathname,char*argv[1,char*envp[])

spawn函數(shù)族在mode模式下運(yùn)行子程序pathname,并將參數(shù)

argO(argl,arg2,argv[],envp口)傳遞給子程序.出錯(cuò)返回T

mode為運(yùn)行模式

mode為P_WAIT表示在子程序運(yùn)行完后返回本程序

P_NOWAIT表示在子程序運(yùn)行時(shí)同時(shí)運(yùn)行本程序(不可用)

P_OVERLAY表示在本程序退出后運(yùn)行子程序

在spawn函數(shù)族中,后綴1、v、p、e添加到spawn后,

所指定的函數(shù)將具有某種操作能力

有后綴p時(shí),函數(shù)利用DOS的PATH查找子程序文件

1時(shí),函數(shù)傳遞的參數(shù)個(gè)數(shù)固定.

v時(shí),函數(shù)傳遞的參數(shù)個(gè)數(shù)不固定.

e時(shí),指定參數(shù)envp可以傳遞給子程序,允許改變子程序運(yùn)行環(huán)境.

當(dāng)無(wú)后綴e時(shí),子程序使用本程序的環(huán)境.

intsystem(char*command)將MSDOS命令command傳遞給DOS執(zhí)行

-轉(zhuǎn)換子程序,函

數(shù)庫(kù)為math,h、stdlib.h>ctype.h、float,h

char*ecvt(doublevalue,intndigit,int*decpt,int*sign)

將浮點(diǎn)數(shù)value轉(zhuǎn)換成字符串并返回該字符串

char*fcvt(doublevalue,intndigit,int*decpt,int*sign)

將浮點(diǎn)數(shù)value轉(zhuǎn)換成字符串并返回該字符串

char*gcvt(doublevalue,intndigit,char*buf)

將數(shù)value轉(zhuǎn)換成字符串并存于buf中,并返回buf的指針

char*ultoa(unsignedlongvalue,char*string,intradix)

將無(wú)符號(hào)整型數(shù)value轉(zhuǎn)換成字符串并返回該字符串,radix為轉(zhuǎn)換時(shí)所用基數(shù)

char*ltoa(longvalue,char*string,intradix)

將長(zhǎng)整型數(shù)value轉(zhuǎn)換成字符串并返回該字符串,radix為轉(zhuǎn)換時(shí)所用基數(shù)

char*itoa(intvalue,char*string,intradix)

將整數(shù)value轉(zhuǎn)換成字符串存入string,radix為轉(zhuǎn)換時(shí)所用基數(shù)

doubleatof(char*nptr)將字符串nptr轉(zhuǎn)換成雙精度數(shù),并返回這個(gè)數(shù),錯(cuò)誤返回0

intatoi(char*nptr)將字符串nptr轉(zhuǎn)換成整型數(shù),并返回這個(gè)數(shù),錯(cuò)誤返回0

longatol(char*nptr)將字符串nptr轉(zhuǎn)換成長(zhǎng)整型數(shù),并返回這個(gè)數(shù),錯(cuò)誤返回0

doublestrtod(char*str,char**ondptr)將字符串str轉(zhuǎn)換成雙精度數(shù),并返回這個(gè)

數(shù),

longstrtol(char*str,char**endptr,intbase)將字符串str轉(zhuǎn)換成長(zhǎng)整型數(shù),

并返回這個(gè)數(shù),

inttoascii(intc)返回c相應(yīng)的ASCII

inttolower(intch)若ch是大寫(xiě)字母(‘A'」Z')返回相應(yīng)的小寫(xiě)字母('a'-'z')

int_tolower(intch)返回ch相應(yīng)的小寫(xiě)字母(‘a(chǎn)'-'z')

inttoupper(intch)若ch是小寫(xiě)字母('a'z')返回相應(yīng)的大寫(xiě)字母('A'Z')

int_toupper(intch)返回ch相應(yīng)的大寫(xiě)字母('A'-'Z')

--------------------------------------------------------------------診斷函數(shù),所在

函數(shù)庫(kù)為assert,h、math,h

voidassert(inttest)一個(gè)擴(kuò)展成if語(yǔ)句那樣的宏,如果test測(cè)試失敗,就顯示一

個(gè)信息并異常終止程序,無(wú)返回值

voidperror(char*string)本函數(shù)將顯示最近一次的錯(cuò)誤信息,格式如下:字符串

string:錯(cuò)誤信息

char*strerror(char*str)本函數(shù)返回最近一次的錯(cuò)誤信息,格式如下:

字符串str:錯(cuò)誤信息

intmatherr(structexception*e)

用戶(hù)修改數(shù)學(xué)錯(cuò)誤返回信息函數(shù)(沒(méi)有必要使用)

double_matherr(_mexcepwhy,char*fun,double*arglp,

double*arg2p,doubleretval)

用戶(hù)修改數(shù)學(xué)錯(cuò)誤返回信息函數(shù)(沒(méi)有必要使用)

輸入輸出子程序,函數(shù)庫(kù)為io.h、conio.h>stat,h、dos.h>stdio.h,signal,h

intkbhitO本函數(shù)返回最近所敲的按鍵

intfgetcharO從控制臺(tái)(鍵盤(pán))讀一個(gè)字符,顯示在屏幕上

intgetchO從控制臺(tái)(鍵盤(pán))讀一個(gè)字符,不顯示在屏幕上

intputch()向控制臺(tái)(鍵盤(pán))寫(xiě)一個(gè)字符

intgetcharO從控制臺(tái)(鍵盤(pán))讀一個(gè)字符,顯示在屏幕上

intputcharO向控制臺(tái)(鍵盤(pán))寫(xiě)一個(gè)字符

intgetcheO從控制臺(tái)(鍵盤(pán))讀一個(gè)字符,顯示在屏幕上

intungetch(intc)把字符c退回給控制臺(tái)(鍵盤(pán))

char*cgets(char*string)從控制臺(tái)(鍵盤(pán))讀入字符串存于string中

intscanf(char*format[,argument…])從控制臺(tái)讀入一個(gè)字符串,分別對(duì)各個(gè)參數(shù)進(jìn)

行賦值,使用BIOS進(jìn)行輸出

intvscanf(char*format,Valistparam)從控制臺(tái)讀入一個(gè)字符串,分別對(duì)各個(gè)參數(shù)進(jìn)

行賦值,使用BIOS進(jìn)行輸此參數(shù)從Valistparam中取得

intcscanf(char*format[,argument…])從控制臺(tái)讀入一個(gè)字符串,分別對(duì)各個(gè)參數(shù)進(jìn)

行賦值,直接對(duì)控制臺(tái)作操作,比如顯示器在顯示時(shí)字符時(shí)即為直接寫(xiě)頻方式顯示int

sscanf(char*string,char*format[,argument,…])通過(guò)字符串string,分別對(duì)各個(gè)參

數(shù)進(jìn)行賦值

intvsscanf(char*string,char*format,Vlistparam)通過(guò)字符串string,分別對(duì)各

個(gè)參數(shù)進(jìn)行賦值,參數(shù)從Vlistparam中取得

intputs(char*string)發(fā)關(guān)一個(gè)字符串string給控制臺(tái)(顯示器),

使用BIOS進(jìn)行輸出

voidcputs(char*string)發(fā)送一個(gè)字符串string給控制臺(tái)(顯示器),

直接對(duì)控制臺(tái)作操作,比如顯示器即為直接寫(xiě)頻方式顯示

intprintf(char*format[,argument,???])發(fā)送格式化字符串輸出給控制臺(tái)(顯示器)

使用BIOS進(jìn)行輸出

intvprintf(char*format,Valistparam)發(fā)送格式化字符串輸出?給控制臺(tái)(顯示器)

使用BIOS進(jìn)行輸出,參數(shù)從Valistparam中取得

intcprintf(char*format[,argument,???])發(fā)送格式化字符串輸出給控制臺(tái)(顯示器),

直接對(duì)控制臺(tái)作操作,比如顯示器即為直接寫(xiě)頻方式顯示

intvcprintf(char*format,Valistparam)發(fā)送格式化字符串輸出給控制臺(tái)(顯示器),

直接對(duì)控制臺(tái)作操作,比如顯示器即為直接寫(xiě)頻方式顯示,

參數(shù)從Valistparam中取得

intsprintf(char*string,char*format[,argument,??,])

將字符串string的內(nèi)容重新寫(xiě)為格式化后的字符串

intvsprintf(char*string,char*format,Valistparam)

將字符串string的內(nèi)容重新寫(xiě)為格式化后的字符串,參數(shù)從Valistparam中取得int

rename(char*oldname,char*ncwnamc)將文件oldname的名稱(chēng)改為newnameint

ioctl(inthandle,intcmd[,int*argdx,intargcx])本函數(shù)是用來(lái)控制輸入/輸出設(shè)備

的,請(qǐng)見(jiàn)下表:

Icmd值|功能!

I0|取出設(shè)備信息|

I1I設(shè)置設(shè)備信息I

I2|把a(bǔ)rgcx字節(jié)讀入由argdx所指的地址|

I3|在argdx所指的地址寫(xiě)argcx字節(jié)|

I4|除把handle當(dāng)作設(shè)備號(hào)(0=當(dāng)前,1=A,等)之外,均和cmd=2時(shí)一樣||5|

除把handle當(dāng)作設(shè)備號(hào)(0=當(dāng)前,1=A,等)之外,均和cmd=3時(shí)一樣||6|取輸入狀態(tài)

I

I7|取輸出狀態(tài)|

I8|測(cè)試可換性;只對(duì)于DOS3.x|

I11I置分享沖突的重算計(jì)數(shù);只對(duì)DOS3.x|

int(*ssignal(intsig,int("action)())()執(zhí)行軟件信號(hào):(沒(méi)必要使用)

intgsignaKintsig)執(zhí)行軟件信號(hào)(沒(méi)必要使用)

int_open(char*pathname,intaccess)為讀或?qū)懘蜷_(kāi)一個(gè)文件,

按后按access來(lái)確定是讀文件還是寫(xiě)文件,access值見(jiàn)下表

Iaccess值|意義

IO_RDONLY|讀文件|

O_WRONLY|寫(xiě)文件|

O_RDWR|即讀也寫(xiě)|

0NOINHERIT|若文件沒(méi)有傳遞給子程序,則被包含|

O_DENYALL|只允許當(dāng)前處理必須存取的文件|

O_DENYWRITE|只允許從任何其它打開(kāi)的文件讀|

0DENYREAD|只允許從任何其它打開(kāi)的文件寫(xiě)|

O_DENYNONE|允許其它共享打開(kāi)的文件|

intopen(char*pathname,intaccess[,intpermiss])為讀或?qū)懘蜷_(kāi)一個(gè)文件,按后

按access來(lái)確定是讀文件還是寫(xiě)文件,access值見(jiàn)下表

access值|意義|

O_RDONLY|讀文件|

O_WRONLY|寫(xiě)文件|

O_RDWR|即讀也寫(xiě)|

O_NDELAY|沒(méi)有使用;對(duì)UNIX系統(tǒng)兼容|

O_APPEND|即讀也寫(xiě),但每次寫(xiě)總是在文件尾添加|

O_CREAT|若文件存在,此標(biāo)志無(wú)用;若不存在,建新文件|

O_TRUNC|若文件存在,則長(zhǎng)度被截為0,屬性不變|

0EXCL|未用;對(duì)UNIX系統(tǒng)兼容|

O_BINARY|此標(biāo)志可顯示地給出以二進(jìn)制方式打開(kāi)文件|

O_TEXT|此標(biāo)志可用于顯示地給出以文本方式打開(kāi)文件|

permiss為文件屬性,可為以下值:

SIWRITE允許寫(xiě)SIREAD允許讀SIREADS_IWRITE允許讀、寫(xiě)intcreat(char

*filename,intpermiss)建立一個(gè)新文件filename,并設(shè)定讀寫(xiě)性。permiss為文件讀

寫(xiě)性,可以為以下值

S」WRITE允許寫(xiě)S」READ允許讀S_IREADS」WRITE允許讀、寫(xiě)int_creat(char

*filename,intattrib)建立?個(gè)新文件filename,并設(shè)定文件屬性。attrib為文件屬

性,可以為以下值

FA_RDONLY只讀FA_HIDDEN隱藏FA_SYSTEM系統(tǒng)

intcreatnew(char*filenamt,intattrib)建立,個(gè)新文件filename,并設(shè)定文件

屬性。attrib為文件屬性,可以為以下值

FA_RDONLY只讀FA_HIDDEN隱

溫馨提示

  • 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶(hù)所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶(hù)上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶(hù)上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶(hù)因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。

最新文檔

評(píng)論

0/150

提交評(píng)論