freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內(nèi)容

[計(jì)算機(jī)軟件及應(yīng)用]c語(yǔ)言函數(shù)大全適合初學(xué)者(編輯修改稿)

2025-09-13 04:13 本頁(yè)面
 

【文章內(nèi)容簡(jiǎn)介】 t main(void){ define STATUS 2 /* printer status mand */ define PORTNUM 0 /* port number for LPT1 */ int status, abyte=0。 printf(Please turn off your printer. Press any key to continue\n)。 getch()。 status = biosprint(STATUS, abyte, PORTNUM)。 if (status amp。 0x01) printf(Device time out.\n)。 if (status amp。 0x08) printf(I/O error.\n)。 if (status amp。 0x10) printf(Selected.\n)。 if (status amp。 0x20) printf(Out of paper.\n)。 if (status amp。 0x40) printf(Acknowledge.\n)。 if (status amp。 0x80) printf(Not busy.\n)。 return 0。}函數(shù)名: biostime功 能: 讀取或設(shè)置BIOS時(shí)間用 法: long biostime(int cmd, long newtime)。程序例:include include include include int main(void){ long bios_time。 clrscr()。 cprintf(The number of clock ticks since midnight is:\r\n)。 cprintf(The number of seconds since midnight is:\r\n)。 cprintf(The number of minutes since midnight is:\r\n)。 cprintf(The number of hours since midnight is:\r\n)。 cprintf(\r\nPress any key to quit:)。 while(!kbhit()) { bios_time = biostime(0, 0L)。 gotoxy(50, 1)。 cprintf(%lu, bios_time)。 gotoxy(50, 2)。 cprintf(%.4f, bios_time / CLK_TCK)。 gotoxy(50, 3)。 cprintf(%.4f, bios_time / CLK_TCK / 60)。 gotoxy(50, 4)。 cprintf(%.4f, bios_time / CLK_TCK / 3600)。 } return 0。}函數(shù)名: brk功 能: 改變數(shù)據(jù)段空間分配用 法: int brk(void *endds)。程序例:include include int main(void){ char *ptr。 printf(Changing allocation with brk()\n)。 ptr = malloc(1)。 printf(Before brk() call: %lu bytes free\n, coreleft())。 brk(ptr+1000)。 printf( After brk() call: %lu bytes free\n, coreleft())。 return 0。}函數(shù)名: bsearch功 能: 二分法搜索用 法: void *bsearch(const void *key, const void *base, size_t *nelem, size_t width, int(*fcmp)(const void *, const *))。程序例:include include define NELEMS(arr) (sizeof(arr) / sizeof(arr[0]))int numarray[] = {123, 145, 512, 627, 800, 933}。int numeric (const int *p1, const int *p2){ return(*p1 *p2)。}int lookup(int key){ int *itemptr。 /* The cast of (int(*)(const void *,const void*)) is needed to avoid a type mismatch error at pile time */ itemptr = bsearch (amp。key, numarray, NELEMS(numarray), sizeof(int), (int(*)(const void *,const void *))numeric)。 return (itemptr != NULL)。}int main(void){ if (lookup(512)) printf(512 is in the table.\n)。 else printf(512 isn39。t in the table.\n)。 return 0。}C函數(shù)名: cabs功 能: 計(jì)算復(fù)數(shù)的絕對(duì)值用 法: double cabs(struct plex z)。程序例:include include int main(void){ struct plex z。 double val。 = 。 = 。 val = cabs(z)。 printf(The absolute value of %.2lfi %.2lfj is %.2lf, , , val)。 return 0。}函數(shù)名: calloc功 能: 分配主存儲(chǔ)器用 法: void *calloc(size_t nelem, size_t elsize)。程序例:include include int main(void){ char *str = NULL。 /* allocate memory for string */ str = calloc(10, sizeof(char))。 /* copy Hello into string */ strcpy(str, Hello)。 /* display string */ printf(String is %s\n, str)。 /* free memory */ free(str)。 return 0。}函數(shù)名: ceil功 能: 向上舍入用 法: double ceil(double x)。程序例:include include int main(void){ double number = 。 double down, up。 down = floor(number)。 up = ceil(number)。 printf(original number %\n, number)。 printf(number rounded down %\n, down)。 printf(number rounded up %\n, up)。 return 0。}函數(shù)名: cgets功 能: 從控制臺(tái)讀字符串用 法: char *cgets(char *str)。程序例:include include int main(void){ char buffer[83]。 char *p。 /* There39。s space for 80 characters plus the NULL terminator */ buffer[0] = 81。 printf(Input some chars:)。 p = cgets(buffer)。 printf(\ncgets read %d characters: \%s\\n, buffer[1], p)。 printf(The returned pointer is %p, buffer[0] is at %p\n, p, amp。buffer)。 /* Leave room for 5 characters plus the NULL terminator */ buffer[0] = 6。 printf(Input some chars:)。 p = cgets(buffer)。 printf(\ncgets read %d characters: \%s\\n, buffer[1], p)。 printf(The returned pointer is %p, buffer[0] is at %p\n, p, amp。buffer)。 return 0。}函數(shù)名: chdir功 能: 改變工作目錄用 法: int chdir(const char *path)。程序例:include include include char old_dir[MAXDIR]。char new_dir[MAXDIR]。int main(void){ if (getcurdir(0, old_dir)) { perror(getcurdir())。 exit(1)。 } printf(Current directory is: \\%s\n, old_dir)。 if (chdir(\\)) { perror(chdir())。 exit(1)。 } if (getcurdir(0, new_dir)) { perror(getcurdir())。 exit(1)。 } printf(Current directory is now: \\%s\n, new_dir)。 printf(\nChanging back to orignal directory: \\%s\n, old_dir)。 if (chdir(old_dir)) { perror(chdir())。 exit(1)。 } return 0。}函數(shù)名: _chmod, chmod功 能: 改變文件的訪問(wèn)方式用 法: int chmod(const char *filename, int permiss)。程序例:include sys\include include void make_read_only(char *filename)。int main(void){ make_read_only()。 make_read_only()。 return 0。}void make_read_only(char *filename){ int stat。 stat = chmod(filename, S_IREAD)。 if (stat) printf(Couldn39。t make %s readonly\n, filename)。 else printf(Made %s readonly\n, filename)。}函數(shù)名: chsize功 能: 改變文件大小用 法: int chsize(int handle, long size)。程序例:include include include int main(void){ int handle。 char buf[11] = 0123456789。 /* create text file containing 10 bytes */ handle = open(, O_CREAT)。 write(handle, buf, strlen(buf))。 /* truncate th
點(diǎn)擊復(fù)制文檔內(nèi)容
黨政相關(guān)相關(guān)推薦
文庫(kù)吧 www.dybbs8.com
備案圖片鄂ICP備17016276號(hào)-1