日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

c语言函数大全语法下载,C语言函数大全(语法).doc

發布時間:2023/12/10 编程问答 26 豆豆
生活随笔 收集整理的這篇文章主要介紹了 c语言函数大全语法下载,C语言函数大全(语法).doc 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

C語言函數大全(語法)

函數名: abort功 能: 異常終止一個進程用 法: void abort(void);程序例:#include

#include

int main(void)

{

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

abort();

return 0; /* This is never reached */

}

函數名: abs功 能: 求整數的絕對值用 法: int abs(int i);程序例:#include

#include

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

#include

#include

#include

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; i<80; i++)

{

ch_out = buf[strt+i];

putchar(ch_out);

}

printf("\n");

return(0);

}

函數名: access功 能: 確定文件的訪問權限用 法: int access(const char *filename, int amode);程序例:#include

#include

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

#include

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

#include

#include

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("

總結

以上是生活随笔為你收集整理的c语言函数大全语法下载,C语言函数大全(语法).doc的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。