c語言庫函數4

功 能: 建立一個硬件錯誤處理程序
用 法: void harderr(int (*fptr)());

函數名: hardresume
功 能: 硬件錯誤處理函數
用 法: void hardresume(int rescode);

函數名: highvideo
功 能: 選擇高亮度文本字符
用 法: void highvideo(void);

函數名: hypot
功 能: 計算直角三角形的斜邊長
用 法: double hypot(double x, double y);

函數名: imagesize
功 能: 返回保存位圖像所需的字節數
用 法: unsigned far imagesize(int left, int top, int right, int bottom);

函數名: initgraph
功 能: 初始化圖形系統
用 法: void far initgraph(int far *graphdriver, int far *graphmode

函數名: inport
功 能: 從硬件端口中輸入
用 法: int inp(int protid);

函數名: insline
功 能: 在文本窗口中插入一個空行
用 法: void insline(void);

函數名: installuserdriver
功 能: 安裝設備驅動程序到BGI設備驅動程序表中
用 法: int far installuserdriver(char far *name, int (*detect)(void));

函數名: installuserfont
功 能: 安裝未嵌入BGI系統的字體文件(CHR)
用 法: int far installuserfont(char far *name);

函數名: int86
功 能: 通用8086軟中斷接口
用 法: int int86(int intr_num, union REGS *inregs, union REGS *outregs)

函數名: int86x
功 能: 通用8086軟中斷接口
用 法: int int86x(int intr_num, union REGS *insegs, union REGS *outregs,

函數名: intdos
功 能: 通用DOS接口
用 法: int intdos(union REGS *inregs, union REGS *outregs);

函數名: intdosx
功 能: 通用DOS中斷接口
用 法: int intdosx(union REGS *inregs, union REGS *outregs,
struct SREGS *segregs);

函數名: intr
功 能: 改變軟中斷接口
用 法: void intr(int intr_num, struct REGPACK *preg);

函數名: ioctl
功 能: 控制I/O設備
用 法: int ioctl(int handle, int cmd[,int *argdx, int argcx]);

函數名: isatty
功 能: 檢查設備類型
用 法: int isatty(int handle);

函數名: itoa
功 能: 把一整數轉換爲字符串
用 法: char *itoa(int value, char *string, int radix);

函數名: kbhit
功 能: 檢查當前按下的鍵
用 法: int kbhit(void);

函數名: keep
功 能: 退出並繼續駐留
用 法: void keep(int status, int size);

函數名: kbhit
功 能: 檢查當前按下的鍵
用 法: int kbhit(void);

函數名: keep
功 能: 退出並繼續駐留
用 法: void keep(int status, int size);

函數名: labs
用 法: long labs(long n);

函數名: ldexp
功 能: 計算value*2的冪
用 法: double ldexp(double value, int exp);

函數名: ldiv
功 能: 兩個長整型數相除, 返回商和餘數
用 法: ldiv_t ldiv(long lnumer, long ldenom);

函數名: lfind
功 能: 執行線性搜索
用 法: void *lfind(void *key, void *base, int *nelem, int width,
int (*fcmp)());

函數名: line
功 能: 在指定兩點間畫一直線
用 法: void far line(int x0, int y0, int x1, int y1);

函數名: linerel
功 能: 從當前位置點(CP)到與CP有一給定相對距離的點畫一直線
用 法: void far linerel(int dx, int dy);

函數名: localtime
功 能: 把日期和時間轉變爲結構
用 法: struct tm *localtime(long *clock);

函數名: lock
功 能: 設置文件共享鎖
用 法: int lock(int handle, long offset, long length);

函數名: log
功 能: 對數函數ln(x)
用 法: double log(double x);

函數名: log10
功 能: 對數函數log
用 法: double log10(double x);

函數名: longjump
功 能: 執行非局部轉移
用 法: void longjump(jmp_buf env, int val);

函數名: lowvideo
功 能: 選擇低亮度字符
用 法: void lowvideo(void);

函數名: lrotl, _lrotl
功 能: 將無符號長整型數向左循環移位
用 法: unsigned long lrotl(unsigned long lvalue, int count);
unsigned long _lrotl(unsigned long lvalue, int count);

函數名: lsearch
功 能: 線性搜索
用 法: void *lsearch(const void *key, void *base, size_t *nelem,
size_t width, int (*fcmp)(const void *, const void *));

函數名: lseek
功 能: 移動文件讀/寫指針
用 法: long lseek(int handle, long offset, int fromwhere);

main()主函數
每一C 程序都 必須 有一 main() 函數, 可以根據自己的愛好把它放在程序的某
個地方。有些程序員把它放在最前面, 而另一些程序員把它放在最後面, 無論放
在哪個地方, 以下幾點說明都是適合的。
1. main() 參數
在Turbo C2.0啓動過程中, 傳遞main()函數三個參數: argc, argv和env。
* argc: 整數, 爲傳給main()的命令行參數個數。
* argv: 字符串數組。
在DOS 3.X 版本中, argv[0] 爲程序運行的全路徑名; 對DOS 3.0
以下的版本, argv[0]爲空串("") 。
argv[1] 爲在DOS命令行中執行程序名後的第一個字符串;
argv[2] 爲執行程序名後的第二個字符串;
...
argv[argc]爲NULL。
*env: 安符串數組。env[] 的每一個元素都包含ENVVAR=value形式的字符
串。其中ENVVAR爲環境變量如PATH或87。value 爲ENVVAR的對應值如C:/DOS, C:
/TURBOC(對於PATH) 或YES(對於87)。
Turbo C2.0啓動時總是把這三個參數傳遞給main()函數, 可以在用戶程序中
說明(或不說明)它們, 如果說明了部分(或全部)參數, 它們就成爲main()子程序
的局部變量。
請注意: 一旦想說明這些參數, 則必須按argc, argv, env 的順序, 如以下
的例子:
main()
main(int argc)
main(int argc, char *argv[])
main(int argc, char *argv[], char *env[])
其中第二種情況是合法的, 但不常見, 因爲在程序中很少有隻用argc, 而不
用argv[]的情況。

函數名: matherr
功 能: 用戶可修改的數學錯誤處理程序
用 法: int matherr(struct exception *e);

函數名: memccpy
功 能: 從源source中拷貝n個字節到目標destin中
用 法: void *memccpy(void *destin, void *source, unsigned char ch,
unsigned n);

函數名: malloc
功 能: 內存分配函數
用 法: void *malloc(unsigned size);

函數名: memchr
功 能: 在數組的前n個字節中搜索字符
用 法: void *memchr(void *s, char ch, unsigned n);

函數名: memcpy
功 能: 從源source中拷貝n個字節到目標destin中
用 法: void *memcpy(void *destin, void *source, unsigned n);

函數名: memicmp
功 能: 比較兩個串s1和s2的前n個字節, 忽略大小寫
用 法: int memicmp(void *s1, void *s2, unsigned n);

函數名: memmove
功 能: 移動一塊字節
用 法: void *memmove(void *destin, void *source, unsigned n);

函數名: memset
功 能: 設置s中的所有字節爲ch, s數組的大小由n給定
用 法: void *memset(void *s, char ch, unsigned n);

函數名: mkdir
功 能: 建立一個目錄
用 法: int mkdir(char *pathname);

函數名: mktemp
功 能: 建立唯一的文件名
用 法: char *mktemp(char *template);

函數名: MK_FP
功 能: 設置一個遠指針
用 法: void far *MK_FP(unsigned seg, unsigned off);

函數名: modf
功 能: 把數分爲指數和尾數
用 法: double modf(double value, double *iptr);

函數名: movedata
功 能: 拷貝字節
用 法: void movedata(int segsrc, int offsrc, int segdest,
int offdest, unsigned numbytes);

函數名: moverel
功 能: 將當前位置(CP)移動一相對距離
用 法: void far moverel(int dx, int dy);

函數名: movetext
功 能: 將屏幕文本從一個矩形區域拷貝到另一個矩形區域
用 法: int movetext(int left, int top, int right, int bottom,
int newleft, int newtop);

函數名: moveto
功 能: 將CP移到(x, y)
用 法: void far moveto(int x, int y);

函數名: movemem
功 能: 移動一塊字節
用 法: void movemem(void *source, void *destin, unsigned len);

函數名: normvideo
功 能: 選擇正常亮度字符
用 法: void normvideo(void);

函數名: nosound
功 能: 關閉PC揚聲器
用 法: void nosound(void);

函數名: open
功 能: 打開一個文件用於讀或寫

函數名: outport
功 能: 輸出整數到硬件端口中
用 法: void outport(int port, int value);

函數名: outportb
功 能: 輸出字節到硬件端口中
用 法: void outportb(int port, char byte);

函數名: outtext
功 能: 在視區顯示一個字符串
用 法: void far outtext(char far *textstring);

函數名: outtextxy
功 能: 在指定位置顯示一字符串
用 法: void far outtextxy(int x, int y, char *textstring);

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章