C語言函式大全

2022-11-15 19:48:04 字數 5249 閱讀 9466

函式名:abort

功能: 異常終止乙個程序

用法: void abort(void)

函式名: abs

功能: 求整數的絕對值

用法: int abs(int i)

函式名: absread, abswirte

功能: 絕對磁碟扇區讀、寫資料

用法: int absread(int drive, int nsects, int sectno, void *buffer)

int abswrite(int drive, int nsects, in tsectno, void *buffer

函式名: access

功能: 確定檔案的訪問許可權

用法: int access(const char *filename, int amode)

函式名: acos

功能:反余弦函式

用法: double acos(double x)

函式名: allocmem

功能: 分配dos儲存段

用法:int allocmem(unsigned size, unsigned *seg)

函式名: arc

功能: 畫一弧線

用法:void far arc(int x, int y, int stangle, int endangle, int radius)

函式名: asctime

功能: 轉換日期和時間為ascii碼

用法:char *asctime(const struct tm *tblock)

函式名: asin

功能:反正弦函式

用法: double asin(double x)

函式名: assert

功能: 測試乙個條件並可能使程式終止

用法:void assert(int test)

函式名: atan

功能: 反正切函式

用法: double atan(double x)

函式名: atan2

功能: 計算y/x的反正切值

用法: double atan2(double y, double x)

函式名:atexit

功能: 註冊終止函式

用法: int atexit(atexit_t func)

函式名: atof

功能: 把字串轉換成浮點數

用法:double atof(const char *nptr)

函式名: atoi

功能: 把字串轉換成長整型數

用法: int atoi(const char *nptr)

函式名: atol

功能: 把字串轉換成長整型數

用法: long atol(const char *nptr)

函式名: bar

功能: 畫乙個二維條形圖

用法: void far bar(int left, int top, int right, int bottom)

函式名: bar3d

功能: 畫乙個三維條形圖

用法:void far bar3d(int left, int top, int right, int bottom,

int depth, int topflag)

函式名: bdos

功能: dos系統呼叫

用法: int bdos(int dosfun, unsigned dosdx, unsigned dosal)

函式名:bdosptr

功能:dos系統呼叫

用法: int bdosptr(int dosfun, void *argument, unsigned dosal)

函式名:bioscom

功能: 序列i/o通訊

用法:int bioscom(int cmd, char abyte, int port)

函式名:biosdisk

功能: 軟硬碟i/o

用法:int biosdisk(int cmd, int drive, int head, int track, int sector

int nsects, void *buffer)

函式名:biosequip

功能: 檢查裝置

用法:int biosequip(void)

函式名:bioskey

功能: 直接使用bios服務的鍵盤介面

用法:int bioskey(int cmd)

函式名:biosmemory

功能: 返回儲存塊大小

用法:int biosmemory(void)

函式名:biosprint

功能: 直接使用bios服務的印表機i/o

用法:int biosprint(int cmd, int byte, int port)

函式名:biostime

功能: 讀取或設定bios時間

用法: long biostime(int cmd, long newtime)

函式名: brk

功能: 改變資料段空間分配

用法:int brk(void *endds)

函式名:bsearch

功能: 二分法搜尋

用法:void *bsearch(const void *key, const void *base, size_t *nelem,

size_t width, int(*fcmp)(const void *, const *))

函式名: cabs

功能: 計算複數的絕對值

用法: double cabs(struct complex z);

函式名:calloc

功能:分配主儲存器

用法:void *calloc(size_t nelem, size_t elsize);

函式名: ceil

功能: 向上捨入

用法: double ceil(double x);

函式名: cgets

功能: 從控制台讀字串

用法: char *cgets(char *str)

函式名:chdir

功能: 改變工作目錄

用法: int chdir(const char *path);

函式名:_chmod, chmod

功能: 改變檔案的訪問方式

用法: int chmod(const char *filename, int permiss);

函式名:chsize

功能: 改變檔案大小

用法: int chsize(int handle, long size);

函式名: circle

功能: 在給定半徑以(x, y)為圓心畫圓

用法: void far circle(int x, int y, int radius);

函式名: cleardevice

功能: 清除圖形螢幕

用法: void far cleardevice(void);

函式名:clearerr

功能: 復位錯誤標誌

用法:void clearerr(file *stream);

函式名: clearviewport

功能: 清除圖形視區

用法: void far clearviewport(void);

函式名:_close, close

功能: 關閉檔案控制代碼

用法:int close(int handle);

函式名: clock

功能:確定處理器時間

用法: clock_t clock(void);

函式名:closegraph

功能: 關閉圖形系統

用法: void far closegraph(void);

函式名:clreol

功能: 在文字視窗中清除字元到行末

用法:void clreol(void)

函式名:clrscr

功能: 清除文字模式視窗

用法:void clrscr(void);

函式名: coreleft

功能: 返回未使用記憶體的大小

用法:unsigned coreleft(void);

函式名: cos

功能: 余弦函式

用法:double cos(double x);

函式名:cosh

功能: 雙曲余弦函式

用法: dluble cosh(double x);

函式名: country

功能: 返回與國家有關的資訊

用法: struct country *country(int countrycode, struct country *country);

函式名: cprintf

功能: 送格式化輸出至螢幕

用法:int cprintf(const char *format[, argument, ...]);

函式名: cputs

功能: 寫字元到螢幕

用法: void cputs(const char *string);

函式名: _creat creat

功能: 建立乙個新檔案或重寫乙個已存在的檔案

用法: int creat (const char *filename, int permiss)

函式名:creatnew

功能: 建立乙個新檔案

用法:int creatnew(const char *filename, int attrib);

函式名: cscanf

功能: 從控制台執行格式化輸入

用法:int cscanf(char *format[,argument, ...]);

函式名: ctime

功能: 把日期和時間轉換為字串

用法:char *ctime(const time_t *time);

函式名: ctrlbrk

功能: 設定ctrl-break處理程式

用法: void ctrlbrk(*fptr)(void);

函式名: delay

功能: 將程式的執行暫停一段時間(毫秒)

用法: void delay(unsigned milliseconds);

函式名: delline

功能: 在文字視窗中刪去一行

用法: void delline(void);

函式名:detectgraph

功能: 通過檢測硬體確定圖形驅動程式和模式

用法: void far detectgraph(int far *graphdriver, int far *graphmode);

C語言函式用法大全

函式名 stpcpy 功能 拷貝乙個字串到另乙個 用法 char stpcpy char destin,char source 程式例 include include int main void 函式名 strcat 功能 字串拼接函式 用法 char strcat char destin,char...

C語言庫函式大全

absread 讀磁碟絕對扇區函式 原形 int absread int drive,int num,int sectnum,void buf 功能 從drive指定的驅動器磁碟上,sectnum指定的邏輯扇區號開始讀取 通過dos中斷0x25讀取 num個 最多64k個 扇區的內容,儲存於buf所...

C語言字串函式大全

函式名 stpcpy 功能 拷貝乙個字串到另乙個 用法 char stpcpy char destin,char source 程式例 include include int main void 函式名 strcat 功能 字串拼接函式 用法 char strcat char destin,char...