1 / 15
文档名称:

c语言d函数.doc

格式:doc   大小:45KB   页数:15页
下载后只包含 1 个 DOC 格式的文档,没有任何的图纸或源代码,查看文件列表

如果您已付费下载过本站文档,您可以点这里二次下载

分享

预览

c语言d函数.doc

上传人:phl808 2017/3/29 文件大小:45 KB

下载得到文件列表

c语言d函数.doc

相关文档

文档介绍

文档介绍:C 语言 D 函数函数名: delay 功能: 将程序的执行暂停一段时间( 毫秒) 用法: void delay(unsigned milliseconds); 程序例: /* Emits a 440-Hz tone for 500 milliseconds */ #include <> int main(void) { sound(440); delay(500); nosound(); return 0; } 函数名: delline 功能: 在文本窗口中删去一行用法: void delline(void); 程序例: #include <> int main(void) { clrscr(); cprintf("The function DELLINE deletes \ the line containing the\r\n"); cprintf("cursor and moves all lines \ below it one line up.\r\n"); cprintf("DELLINE operates within the \ currently active text\r\n"); cprintf("window. Press any key to\ continue .. ."); gotoxy(1,2); /* Move the cursor to the second line and first column */ getch(); delline(); getch(); return 0; } 函数名: detectgraph 功能: 通过检测硬件确定图形驱动程序和模式用法: void far detectgraph(int far *graphdriver, int far *graphmode); 程序例: #include <> #include <> #include <> #include <> /* names of the various cards supported */ char *dname[] ={ "requests detection", "a CGA", "an MCGA", "an EGA", "a 64K EGA", "a monochrome EGA", "an IBM 8514", "a Hercules monochrome", "an AT&T 6300 PC", "a VGA", "an IBM 3270 PC" }; int main(void) { /* returns detected hardware info. */ int gdriver, gmode, errorcode; /* detect graphics hardware available */ detectgraph(&gdriver, &gmode); /* read result of detectgraph call */ errorcode = graphresult(); if (errorcode != grOk) /* an error occurred */ { printf("Graphics error: %s\n", \ grapherrormsg(errorcode)); printf("Press any key to halt:"); getch(); exit(1); /* terminate with an error code */ } /* display the information detected */ clrscr(); printf("You have %s video display \ card.\n", dname[gdriver]); printf("Press any key to halt:"); getch(); return 0; } 函数名: difftime 功能: 计算两个时刻之间的时间差用法: double difftime(time_t time2, time_t time1); 程序例: #include <> #include <> #include <> #include <> int main(void) { time_t first, second; clrscr(); first = time(NULL); /* Gets system time */ delay(2000); /* Waits 2 secs */ second = time(NULL);