c語言能用的函數,c語言函數的用法

求C語言的常用函數,詳細一點

C語言的常用庫函數

目前創新互聯公司已為成百上千家的企業提供了網站建設、域名、網絡空間、成都網站托管、企業網站設計、開魯網站維護等服務,公司將堅持客戶導向、應用為本的策略,正道將秉承"和諧、參與、激情"的文化,與客戶和合作伙伴齊心協力一起成長,共同發展。

函數1。absread()讀磁盤絕對扇區函數

函數2。abswrite()寫磁盤絕對扇區函數

函數3。atof()將字符串轉換成浮點數的函數

函數4。atoi()將字符串轉換成整型數的函數

函數5。atol()將字符串轉換成長整型數的函數

函數6。bcd()把一個數轉換成對應的BCD碼的函數

函數7。bdos()

函數8。biosdisk()調用BIOS磁盤驅動程序函數

函數9。biosprint()調用BIOS打印機I/O接口的函數

函數10。calloc()分配內存函數

函數11。ceil()

函數12。cgets()讀字符串函數

函數13。chdir()改變當前目錄的函數

函數14。_chmod()改變文件存取權限的函數

函數15。chmod()改變文件存取權限的函數

函數16。clock()

函數17。close()關閉文件函數

函數18。closegraph()關閉圖形函數

函數19。cos()

函數20。ctrlbrk()設置ctrl-break處理程序的函數

函數21。delay()暫停函數

函數22。disable()屏蔽中斷的宏

函數23。enable()開硬件中斷的宏

函數24。exec()加載并運行其它程序的函數族

函數25。farcalloc()從遠堆中分配內存的函數

函數26。farfree()從遠堆中釋放一塊已分配內存的函數

函數27。farmalloc()從遠堆中分配內存的函數

函數28。farrealloc()調整遠堆中已分配塊的函數

函數29。fclose()關閉一個流函數

函數30。fcloseall()關閉打開的流的函數

函數31。feof()檢查文件是否結束的函數

函數32。fgets()從流中讀取一字符串的函數

函數33。findfirst()函數和findnext()函數

函數34。floodfill()填充區域的函數

函數35。floor()

函數36。fnmerge()建立文件路徑函數

函數37。fnsplit()分解完整的路徑名函數

函數38。fopen()打開一個流函數

函數39。FP_OFF()獲取遠地址偏移量的宏

函數40。fprintf()傳送輸出到一個流中的函數

函數41。FP_SEG()獲取遠地址段值的宏

函數42。fscanf()格式化輸入函數

函數43。fseek()移動文件指針函數

函數44。fwrite()把參數寫入流中的函數

函數45。gcvt()把雙精度數轉化成字符串的函數

函數46。geninterrupt()執行中斷函數

函數47。getc()從流中取字符的宏

函數48。getch()從鍵盤無回顯地讀取一字符的函數

函數49。getchar()從stdin流中讀取一個字符的函數

函數50。getcurdir()讀取指定驅動器的當前目錄的函數

函數61。getcwd()讀取當前目錄的函數

函數62。getdate()讀取系統日期函數

函數63。getdfree()讀取磁盤空閑空間的函數

函數64。getdisk()讀取當前磁盤驅動器號函數

函數65。getenv()讀取環境變量的當前值的函數

函數66。getimage()將指定區域的位圖象存入內存的函數

函數67。getmaxx()返回屏幕上最大的X坐標值的函數

函數68。getmaxy()返回屏幕上最大的Y坐標值的函數

函數69。getpixel()讀取像素顏色的函數

函數70。getpsp()

函數71。gets()從標準輸入流stdio中讀取一字符串的函數

函數72。gettime()讀取系統時間的函數

函數73。getvect()讀取中斷向量函數

函數74。getx()返回當前圖形方式下位置的X坐標值的函數

函數75。gety()返回當前圖形方式下位置的Y坐標值的函數

函數76。imagesize()返回保存圖像緩沖區大小的函數

函數77。initgraph()顯示模式控制函數(初始化圖形系統函數)

函數78。inport()從端口中讀入一個字的函數

函數79。inportb()從端口讀入一個字節的函數

函數80。int86()執行中斷函數(調用8086軟中斷函數)

函數81。int86x()執行中斷函數 (通用8086軟中斷接口函數)

函數82。intdos()通用dos中斷接口函數

函數83。intdosx()通用dos中斷接口函數

函數84。intr()執行8086軟中斷函數(改變軟中斷接口函數)

函數85。itoa()把整形數轉換為字符串的函數

函數86。kbhit()檢查當前按下的鍵的函數

函數87。keep()駐留并退出函數

函數88。log()

函數89。log10()

函數90。_lrotl()將一個無符號長整形數左循環移位的函數

函數91。_lrotr()將一個無符號長整形數右循環移位的函數

函數92。lseek()移動文件指針函數

函數93。ltoa()把長整形數轉換為字符串的函數

函數94。malloc()分配內存函數

函數95。mkdir()創建目錄函數

函數96。mktemp()建立一個唯一的文件名的函數

函數97。MK_FP()設置一個遠指針的宏

函數98。movedata()拷貝數據函數

函數99。_open()打開一個文件進行讀寫的函數

函數100。open()打開文件進行讀寫的函數

函數101。outport()輸出一個字到端口中的函數

函數102。outportb()輸出一個字節到端口中的函數

函數103。outtextxy()在指定位置顯示一字符串的函數

函數104。peek()返回指定內存中字的函數

函數105。peekb()返回指定內存中字節的函數

函數106。poke()在指定的內存中存儲一個字的函數

函數107。pokeb()在指定的內存中存儲一個字節的函數

函數108。pow()

函數109。printf()寫格式化輸出到stdout的函數

函數110。putch()向屏幕輸出字符的函數

函數111。putchar()在stdout上輸出字符的宏

函數112。putenv()將字符串放入當前環境中的函數

函數113。putimage()重新寫屏函數(輸出一個位圖象到圖形屏幕上的函數)

函數114。putpixel()寫像素點函數

函數115。puts()輸出一字符串到stdout(標準輸出)的函數

函數116。_read()讀文件函數

函數117。read()讀文件函數

函數118。realloc()重新分配內存函數

函數119。rectangle()畫一個矩形的函數

函數120。remove()刪除一個文件的函數

函數121。rename()文件改名函數

函數122。restorecrtmode()恢復屏幕視頻模式為調用initgraph前的設置的函數

函數123。rmdir()刪除目錄函數

函數124。_rotl()將一個無符號整形數左循環移位的函數

函數125。_rotr()將一個無符號整形數右循環移位的函數

函數126。scanf()格式化輸入函數

函數127。searchpath()按dos路徑查找一個文件的函數

函數128。segread()讀段寄存器函數

函數129。setactivepage()設置圖形輸出活動頁的函數

函數130。setcolor()設置當前要畫的線顏色的函數

函數131。setdisk()設置當前驅動器的函數

函數132。setgraphmode()將系統設置成圖形模式并清屏的函數

函數133。setlinestyle()設置當前畫線寬度和類型的函數

函數134。settextstyle()顯示字符的當前設置函數

函數135。setvect()設置中斷向量函數

函數136。setviewport()建立視口的函數

函數137。setvisualpage()設置可見的圖形頁號的函數

函數138。sin()

函數139。sprintf()格式化輸出到數組的函數

函數140。strcat()

函數141。tan()

函數142。_write()寫文件函數

函數143。write()寫文件函數

原文釋義請到百度文庫里搜尋字串“C語言常用函數”后下載

函數51-60因原注里排序號碼少編,所以只有133個常用函數。

DOC大小是119.5KB

貢獻時間:2010-09-10

貢獻者:handanlinzhang

C語言常用詞匯及函數有那些?

常用詞匯:

1、short:修飾int,短整型數據,可省略被修飾的int。

2、long:修飾int,長整型數據,可省略被修飾的int。

3、long long:修飾int,超長整型數據,可省略被修飾的int。

4、signed:修飾整型數據,有符號數據類型。

5、unsigned:修飾整型數據,無符號數據類型。

6、restrict:用于限定和約束指針,并表明指針是訪問一個數據對象的唯一且初始的方式。

7、return:用在函數體中,返回特定值(如果是void類型,則不返回函數值)。

8、continue:結束當前循環,開始下一輪循環。

9、break:跳出當前循環或switch結構。

10、goto:無條件跳轉語句。

11、if:條件語句,后面不需要放分號。

12、else:條件語句否定分支(與if連用)。

13、switch:開關語句(多重分支語句)。

14、case:開關語句中的分支標記,與switch連用。

15、default:開關語句中的“其他”分支,可選。

常用函數:

1、int isalpha(int ch) 若ch是字母('A'-'Z','a'-'z'),返回非0值,否則返回0。

2、int isalnum(int ch) 若ch是字母('A'-'Z','a'-'z')或數字('0'-'9'),返回非0值,否則返回0。

3、int abs(int i) 返回整型參數i的絕對值。

4、double cabs(struct complex znum) 返回復數znum的絕對值。

5、double fabs(double x) 返回雙精度參數x的絕對值。

6、long labs(long n) 返回長整型參數n的絕對值。

參考資料來源:百度百科—C語言

c語言中有哪些函數

C語言輸入輸出函數有很多,標準I/O函數中包含了如下幾個常用的函數:

scanf,printf,getc,putc,getchar,putchar,gets,puts,fgets,fputs,fgetc,fputc,fscanf,fprintf等.

int

getc(FILE

*fp)

getc主要是從文件中讀出一個字符.常用的判斷文件是否讀取結束的語句為

(ch

=

getc(fp))

!=

EOF.EOF為文件結束標志,定義在stdio.h中,就像EXIT_SUCCESS,EXIT_FAILURE定義在stdlib.h中一樣,文件也可以被理解為一種流,所以當fp為stdin時,getc(stdin)就等同于getchar()了.

int

putc(int

ch,FILE

*fp)

putc主要是把字符ch寫到文件fp中去.如果fp為stdout,則putc就等同于putchar()了.

int

getchar(void)

getchar主要是從標準輸入流讀取一個字符.默認的標準輸入流即stdio.h中定義的stdin.但是從輸入流中讀取字符時又涉及到緩沖的問題,所以并不是在屏幕中敲上一個字符程序就會運行,一般是通過在屏幕上敲上回車鍵,然后將回車前的字符串放在緩沖區中,getchar就是在緩沖區中一個一個的讀字符.當然也可以在while循環中指定終止字符,如下面的語句:while

((c

=

getchar())

!=

'#')這是以#來結束的.

int

putchar(int

ch)

putchar(ch)主要是把字符ch寫到標準流stdout中去.

char

*

gets(char

*str)

gets主要是從標準輸入流讀取字符串并回顯,讀到換行符時退出,并會將換行符省去.

int

puts(char

*str)

puts主要是把字符串str寫到標準流stdout中去,并會在輸出到最后時添加一個換行符.

char

*fgets(char

*str,

int

num,

FILE

*fp)

str是存放讀入的字符數組指針,num是最大允許的讀入字符數,fp是文件指針.fgets的功能是讀一行字符,該行的字符數不大于num-1.因為fgets函數會在末尾加上一個空字符以構成一個字符串.另外fgets在讀取到換行符后不會將其省略.

int

fputs(char

*str,

file

*fp)

fputs將str寫入fp.fputs與puts的不同之處是fputs在打印時并不添加換行符.

int

fgetc(FILE

*fp)

fgetc從fp的當前位置讀取一個字符.

int

fputc(int

ch,

file

*fp)

fputc是將ch寫入fp當前指定位置.

int

fscanf(FILE

*fp,

char

*format,

輸入列表)

fscanf按照指定格式從文件中出讀出數據,并賦值到參數列表中.

int

fprintf(FILE

*fp,

char

*format,

輸出列表)

fprintf將格式化數據寫入流式文件中.

數據塊讀寫函數

fread

(buffer,size,count,fp);

fwrite(buffer,size,count,fp);

參數說明:

buffer:是一個指針。

對fread

來說,它是讀入數據的存放地址。

對fwrite來說,是要輸出數據的地址(均指起始地址)。

size:

要讀寫的字節數。

count:

要進行讀寫多少個size字節的數據項。

fp:

文件型指針。

求C語言函數大全

函數名: abort

功 能: 異常終止一個進程

用 法: void abort(void);

程序例:

#include stdio.h

#include stdlib.h

int main(void)

{

printf("Calling abort()\n");

abort();

return 0; /* This is never reached */

}

函數名: abs

功 能: 求整數的絕對值

用 法: int abs(int i);

程序例:

#include stdio.h

#include math.h

int main(void)

{

int number = -1234;

printf("number: %d absolute value: %d\n", number, abs(number));

return 0;

}

函數名: absread, abswirte

功 能: 絕對磁盤扇區讀、寫數據

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

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

程序例:

/* absread example */

#include stdio.h

#include conio.h

#include process.h

#include dos.h

int main(void)

{

int i, strt, ch_out, sector;

char buf[512];

printf("Insert a diskette into drive A and press any key\n");

getch();

sector = 0;

if (absread(0, 1, sector, buf) != 0)

{

perror("Disk problem");

exit(1);

}

printf("Read OK\n");

strt = 3;

for (i=0; i80; i++)

{

ch_out = buf[strt+i];

putchar(ch_out);

}

printf("\n");

return(0);

}

函數名: access

功 能: 確定文件的訪問權限

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

程序例:

#include stdio.h

#include io.h

int file_exists(char *filename);

int main(void)

{

printf("Does NOTEXIST.FIL exist: %s\n",

file_exists("NOTEXISTS.FIL") ? "YES" : "NO");

return 0;

}

int file_exists(char *filename)

{

return (access(filename, 0) == 0);

}

函數名: acos

功 能: 反余弦函數

用 法: double acos(double x);

程序例:

#include stdio.h

#include math.h

int main(void)

{

double result;

double x = 0.5;

result = acos(x);

printf("The arc cosine of %lf is %lf\n", x, result);

return 0;

}

函數名: allocmem

功 能: 分配DOS存儲段

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

程序例:

#include dos.h

#include alloc.h

#include stdio.h

int main(void)

{

unsigned int size, segp;

int stat;

size = 64; /* (64 x 16) = 1024 bytes */

stat = allocmem(size, segp);

if (stat == -1)

printf("Allocated memory at segment: %x\n", segp);

else

printf("Failed: maximum number of paragraphs available is %u\n",

stat);

return 0;

}

函數名: arc

功 能: 畫一弧線

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

程序例:

#include graphics.h

#include stdlib.h

#include stdio.h

#include conio.h

int main(void)

{

/* request auto detection */

int gdriver = DETECT, gmode, errorcode;

int midx, midy;

int stangle = 45, endangle = 135;

int radius = 100;

/* initialize graphics and local variables */

initgraph(gdriver, gmode, "");

/* read result of initialization */

errorcode = graphresult(); /* an error occurred */

if (errorcode != grOk)

{

printf("Graphics error: %s\n", grapherrormsg(errorcode));

printf("Press any key to halt:");

getch();

exit(1); /* terminate with an error code */

}

midx = getmaxx() / 2;

midy = getmaxy() / 2;

setcolor(getmaxcolor());

/* draw arc */

arc(midx, midy, stangle, endangle, radius);

/* clean up */

getch();

closegraph();

return 0;

}

函數名: asctime

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

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

程序例:

#include stdio.h

#include string.h

#include time.h

int main(void)

{

struct tm t;

char str[80];

/* sample loading of tm structure */

t.tm_sec = 1; /* Seconds */

t.tm_min = 30; /* Minutes */

t.tm_hour = 9; /* Hour */

t.tm_mday = 22; /* Day of the Month */

t.tm_mon = 11; /* Month */

t.tm_year = 56; /* Year - does not include century */

t.tm_wday = 4; /* Day of the week */

t.tm_yday = 0; /* Does not show in asctime */

t.tm_isdst = 0; /* Is Daylight SavTime; does not show in asctime */

/* converts structure to null terminated

string */

strcpy(str, asctime(t));

printf("%s\n", str);

return 0;

}

函數名: asin

功 能: 反正弦函數

用 法: double asin(double x);

程序例:

#include stdio.h

#include math.h

int main(void)

{

double result;

double x = 0.5;

result = asin(x);

printf("The arc sin of %lf is %lf\n", x, result);

return(0);

}

函數名: assert

功 能: 測試一個條件并可能使程序終止

用 法: void assert(int test);

程序例:

#include assert.h

#include stdio.h

#include stdlib.h

struct ITEM {

int key;

int value;

};

/* add item to list, make sure list is not null */

void additem(struct ITEM *itemptr) {

assert(itemptr != NULL);

/* add item to list */

}

int main(void)

{

additem(NULL);

return 0;

}

函數名: atan

功 能: 反正切函數

用 法: double atan(double x);

程序例:

#include stdio.h

#include math.h

int main(void)

{

double result;

double x = 0.5;

result = atan(x);

printf("The arc tangent of %lf is %lf\n", x, result);

return(0);

}

函數名: atan2

功 能: 計算Y/X的反正切值

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

程序例:

#include stdio.h

#include math.h

int main(void)

{

double result;

double x = 90.0, y = 45.0;

result = atan2(y, x);

printf("The arc tangent ratio of %lf is %lf\n", (y / x), result);

return 0;

}

函數名: atexit

功 能: 注冊終止函數

用 法: int atexit(atexit_t func);

程序例:

#include stdio.h

#include stdlib.h

void exit_fn1(void)

{

printf("Exit function #1 called\n");

}

void exit_fn2(void)

{

printf("Exit function #2 called\n");

}

int main(void)

{

/* post exit function #1 */

atexit(exit_fn1);

/* post exit function #2 */

atexit(exit_fn2);

return 0;

}

函數名: atof

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

用 法: double atof(const char *nptr);

程序例:

#include stdlib.h

#include stdio.h

int main(void)

{

float f;

char *str = "12345.67";

f = atof(str);

printf("string = %s float = %f\n", str, f);

return 0;

}

函數名: atoi

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

用 法: int atoi(const char *nptr);

程序例:

#include stdlib.h

#include stdio.h

int main(void)

{

int n;

char *str = "12345.67";

n = atoi(str);

printf("string = %s integer = %d\n", str, n);

return 0;

}

函數名: atol

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

用 法: long atol(const char *nptr);

程序例:

#include stdlib.h

#include stdio.h

int main(void)

{

long l;

char *str = "98765432";

l = atol(lstr);

printf("string = %s integer = %ld\n", str, l);

return(0);

}

C語言中全部可用的數學函數有哪些?

2.long labs(long n); 求長整型數的絕對值。

3.double fabs(double x); 求實數的絕對值。

4.double floor(double x); 求不大于x的最大整數,它相當于數學函數[x]。

5.double ceil(double x); 求不小于x的最小整數。

6.double sqrt(double x); 求x的平方根。

7.double log10(double x); 求x的常用對數。

8.double log(double x); 求x的自然對數。

9.double exp(double x); 求歐拉常數e的x次方。

10.double pow10(int p); 求10的p次方。

11.double pow(double x, double y); 求x的y次方。

12.double sin(double x); 正弦函數。

13.double cos(double x); 余弦函數。

14.double tan(double x); 正切函數。

15.double asin(double x); 反正弦函數。

16.double acos(double x); 反余弦函數。

17.double atan(double x); 反正切函數。

當前標題:c語言能用的函數,c語言函數的用法
網站URL:http://m.kartarina.com/article44/heidee.html

成都網站建設公司_創新互聯,為您提供靜態網站電子商務全網營銷推廣品牌網站設計移動網站建設手機網站建設

廣告

聲明:本網站發布的內容(圖片、視頻和文字)以用戶投稿、用戶轉載內容為主,如果涉及侵權請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網站立場,如需處理請聯系客服。電話:028-86922220;郵箱:631063699@qq.com。內容未經允許不得轉載,或轉載時需注明來源: 創新互聯

h5響應式網站建設
主站蜘蛛池模板: 亚洲av永久无码精品网站| AV无码免费永久在线观看| 无码伊人66久久大杳蕉网站谷歌 | 久久精品无码一区二区三区免费| 亚洲AⅤ永久无码精品AA| 亚洲精品无码日韩国产不卡av| 亚洲日韩精品A∨片无码| 五月婷婷无码观看| 少妇无码太爽了不卡视频在线看 | 久久久久亚洲AV成人无码网站| 亚洲youwu永久无码精品| 亚洲av无码一区二区三区天堂古代| 国产无码一区二区在线| 日韩精品无码免费专区网站| 免费VA在线观看无码| 无码欧精品亚洲日韩一区| 无码人妻精品一区二区三区东京热 | 日韩人妻无码精品专区| 97精品人妻系列无码人妻| 亚洲精品无码午夜福利中文字幕 | 久久人妻无码中文字幕| 亚洲自偷自偷偷色无码中文| 性色av无码不卡中文字幕| 久久久久亚洲AV无码专区桃色| 精品无码免费专区毛片| 麻豆亚洲AV永久无码精品久久| 无码一区二区三区视频| 亚洲欧洲美洲无码精品VA| 东京热加勒比无码少妇| 国产仑乱无码内谢| 久久国产精品无码网站| 一道久在线无码加勒比| 无码熟熟妇丰满人妻啪啪软件| 亚洲人成人伊人成综合网无码| 久久久久久久人妻无码中文字幕爆| 国产午夜无码精品免费看动漫 | 免费a级毛片无码av| 亚洲AV无码乱码在线观看牲色| 亚洲av无码成人影院一区| 无码av高潮喷水无码专区线| 亚洲AV无码国产精品色|