亚洲香蕉成人av网站在线观看_欧美精品成人91久久久久久久_久久久久久久久久久亚洲_热久久视久久精品18亚洲精品_国产精自产拍久久久久久_亚洲色图国产精品_91精品国产网站_中文字幕欧美日韩精品_国产精品久久久久久亚洲调教_国产精品久久一区_性夜试看影院91社区_97在线观看视频国产_68精品久久久久久欧美_欧美精品在线观看_国产精品一区二区久久精品_欧美老女人bb

首頁 > 學院 > 開發設計 > 正文

C語言庫函數 (D類字母)

2019-11-17 05:43:19
字體:
來源:轉載
供稿:網友
[ 發表日期:2002-1-4 9:28:46 ]

函數名: delay
功 能: 將程序的執行暫停一段時間(毫秒)
用 法: void delay(unsigned milliseconds);
程序例:
/* Emits a 440-Hz tone for 500 milliseconds */
#include <dos.h>
int main(void)
{
sound(440);
delay(500);
nosound(); return 0;
} 函數名: delline
功 能: 在文本窗口中刪去一行
用 法: void delline(void);
程序例: #include <conio.h> 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 <graphics.h>
#include <stdlib.h>
#include <stdio.h>
#include <conio.h> /* 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 <time.h>
#include <stdio.h>
#include <dos.h>
#include <conio.h> int main(void)
{
time_t first, second; clrscr();
first = time(NULL); /* Gets system
time */
delay(2000); /* Waits 2 secs */
second = time(NULL); /* Gets system time
again */ printf("The difference is: %f /
seconds/n",difftime(second,first));
getch(); return 0;
} 函數名: disable
功 能: 屏蔽中斷
用 法: void disable(void);
程序例: /***NOTE: This is an interrupt service
routine. You cannot compile this program
with Test Stack Overflow turned on and
get an executable file that operates
correctly. */
#include <stdio.h>
#include <dos.h>
#include <conio.h> #define INTR 0X1C /* The clock tick
interrupt */ void interrupt ( *oldhandler)(void); int count=0; void interrupt handler(void)
{
/* disable interrupts during the handling of
the interrupt */
disable();
/* increase the global counter */
count++;
/* reenable interrupts at the end of the
handler */
enable();
/* call the old routine */
oldhandler();
} int main(void)
{
/* save the old interrupt vector */
oldhandler = getvect(INTR); /* install the new interrupt handler */
setvect(INTR, handler); /* loop until the counter exceeds 20 */
while (count < 20)
printf("count is %d/n",count);
/* reset the old interrupt handler */
setvect(INTR, oldhandler); return 0;
} 函數名: div
功 能: 將兩個整數相除, 返回商和余數
用 法: div_t (int number, int denom);
程序例: #include <stdlib.h>
#include <stdio.h> div_t x; int main(void)
{
x = div(10,3);
printf("10 div 3 = %d remainder %d/n", x.quot, x.rem); return 0;
} 函數名: dosexterr
功 能: 獲取擴展DOS錯誤信息
用 法: int dosexterr(strUCt DOSERR *dblkp);
程序例: #include <stdio.h>
#include <dos.h> int main(void)
{
FILE *fp;
struct DOSERROR info; fp = fopen("perror.dat","r");
if (!fp) perror("Unable to open file for
reading");
dosexterr(&info);
printf("Extended DOS error /
information:/n");
printf(" Extended error: /
%d/n",info.exterror);
printf(" Class: /
%x/n",info.class);
printf(" Action: /
%x/n",info.action);
printf(" Error Locus: /
%x/n",info.locus); return 0;
} 函數名: dostounix
功 能: 轉換日期和時間為UNIX時間格式
用 法: long dostounix(struct date *dateptr, struct time *timeptr);
程序例: #include <time.h>
#include <stddef.h>
#include <dos.h>
#include <stdio.h> int main(void)
{
time_t t;
struct time d_time;
struct date d_date;
struct tm *local; getdate(&d_date);
gettime(&d_time);
t = dostounix(&d_date, &d_time);
local = localtime(&t);
printf("Time and Date: %s/n", /
asctime(local)); return 0;
} 函數名: drawpoly
功 能: 畫多邊形
用 法: void far drawpoly(int numpoints, int far *polypoints);
程序例: #include <graphics.h>
#include <stdlib.h>
#include <stdio.h>
#include <conio.h> int main(void)
{
/* request auto detection */
int gdriver = DETECT, gmode, errorcode;
int maxx, maxy; /* our polygon array */
int poly[10]; /* initialize graphics and local
variables */
initgraph(&gdriver, &gmode, ""); /* read result of initialization */
errorcode = graphresult();
if (errorcode != grOk)
/* an error occurred */
{
printf("Graphics error: %s/n", /
grapherrormsg(errorcode));
printf("Press any key to halt:");
getch();
/* terminate with an error code */
exit(1);
}
maxx = getmaxx();
maxy = getmaxy(); poly[0] = 20; /* 1st vertext */
poly[1] = maxy / 2; poly[2] = maxx - 20; /* 2nd */
poly[3] = 20; poly[4] = maxx - 50; /* 3rd */
poly[5] = maxy - 20; poly[6] = maxx / 2; /* 4th */
poly[7] = maxy / 2;
/*
drawpoly doesn't automatically close
the polygon, so we close it.
*/
poly[8] = poly[0];
poly[9] = poly[1]; /* draw the polygon */
drawpoly(5, poly); /* clean up */
getch();
closegraph();
return 0;
} 函數名: dup
功 能: 復制一個文件句柄
用 法: int dup(int handle);
程序例: #include <string.h>
#include <stdio.h>
#include <conio.h>
#include <io.h>
void flush(FILE *stream); int main(void)
{
FILE *fp;
char msg[] = "This is a test"; /* create a file */
fp = fopen("DUMMY.FIL", "w"); /* write some data to the file */
fwrite(msg, strlen(msg), 1, fp); clrscr();
printf("Press any key to flush /
DUMMY.FIL:");
getch(); /* flush the data to DUMMY.FIL without
closing it */
flush(fp); printf("/nFile was flushed, Press any /
key to quit:");
getch();
return 0;
} void flush(FILE *stream)
{
int duphandle; /* flush TC's internal buffer */
fflush(stream); /* make a duplicate file handle */
duphandle = dup(fileno(stream));
/* close the duplicate handle to flush the
DOS buffer */
close(duphandle);
} 函數名: dup2
功 能: 復制文件句柄
用 法: int dup2(int oldhandle, int newhandle);
程序例: #include <sys/stat.h>
#include <string.h>
#include <fcntl.h>
#include <io.h> int main(void)
{
#define STDOUT 1 int nul, oldstdout;
char msg[] = "This is a test"; /* create a file */
nul = open("DUMMY.FIL", O_CREAT O_RDWR,
S_IREAD S_IWRITE); /* create a duplicate handle for standard
output */
oldstdout = dup(STDOUT);
/*
redirect standard output to DUMMY.FIL
by duplicating the file handle onto the
file handle for standard output.
*/
dup2(nul, STDOUT);
/* close the handle for DUMMY.FIL */
close(nul); /* will be redirected into DUMMY.FIL */
write(STDOUT, msg, strlen(msg)); /* restore original standard output
handle */
dup2(oldstdout, STDOUT); /* close duplicate handle for STDOUT */
close(oldstdout); return 0;
}











發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
亚洲香蕉成人av网站在线观看_欧美精品成人91久久久久久久_久久久久久久久久久亚洲_热久久视久久精品18亚洲精品_国产精自产拍久久久久久_亚洲色图国产精品_91精品国产网站_中文字幕欧美日韩精品_国产精品久久久久久亚洲调教_国产精品久久一区_性夜试看影院91社区_97在线观看视频国产_68精品久久久久久欧美_欧美精品在线观看_国产精品一区二区久久精品_欧美老女人bb
在线看福利67194| 欧洲亚洲在线视频| 亚洲精品国产品国语在线| 亚洲天堂网在线观看| 国语对白做受69| 1769国产精品| 欧美中文在线观看国产| 国内精品美女av在线播放| 91亚洲国产成人精品性色| 国产精品久久久久不卡| 日韩欧美成人免费视频| 国产亚洲精品久久久优势| 亚洲开心激情网| 国产中文字幕91| 欧美激情喷水视频| 国产精品国产亚洲伊人久久| 欧美日韩电影在线观看| 色综合久久中文字幕综合网小说| 亚洲色图综合网| 久久久av亚洲男天堂| 国产一区二区三区视频| 欧美午夜影院在线视频| 亚洲女人天堂色在线7777| 亚洲国产天堂网精品网站| 国产精品久久久久免费a∨| 亚洲精品在线看| 国产91色在线|| 久久躁狠狠躁夜夜爽| 亚洲尤物视频网| 97在线免费视频| 国产有码一区二区| 一区二区三区四区视频| 日韩激情视频在线播放| 疯狂做受xxxx欧美肥白少妇| 懂色aⅴ精品一区二区三区蜜月| 亚洲一区美女视频在线观看免费| 亚洲91精品在线观看| 色悠久久久久综合先锋影音下载| 午夜免费日韩视频| 最近2019中文字幕一页二页| 日韩欧美在线中文字幕| 91在线免费看网站| 亚洲第一视频网| 欧美xxxx综合视频| 夜夜躁日日躁狠狠久久88av| 亚洲成人a级网| 日韩av中文字幕在线播放| 欧美日韩国产精品一区二区三区四区| 国产精彩精品视频| 国产免费一区视频观看免费| 国产精品美女无圣光视频| 亚洲国产精品视频在线观看| 尤物九九久久国产精品的分类| 色综合久久悠悠| 成人在线免费观看视视频| 欧美日韩在线视频一区二区| 国产美女精品视频| 国产亚洲视频在线| 中文字幕欧美亚洲| 亚洲色图17p| 成人高清视频观看www| 久久亚洲精品网站| 亚洲精品99久久久久| 91牛牛免费视频| 国产成人精品午夜| 久久视频在线直播| 日韩免费av在线| 国产精品亚洲美女av网站| 国产91网红主播在线观看| 日韩av在线网页| 亚洲人成在线观看网站高清| 欧美成人黑人xx视频免费观看| 中文字幕日韩精品在线| 成人黄色午夜影院| 久久影院资源站| 高跟丝袜一区二区三区| 韩曰欧美视频免费观看| 久久免费视频在线观看| 国产成人精彩在线视频九色| 国产三级精品网站| 欧美乱大交xxxxx另类电影| 日韩欧美成人精品| 日韩电影大全免费观看2023年上| 欧美有码在线观看| 亚洲一区亚洲二区| 亚洲成成品网站| 国模精品一区二区三区色天香| 久久精品免费播放| 国产成人精品久久亚洲高清不卡| 国产成人精彩在线视频九色| 国产一区香蕉久久| 日韩中文在线中文网三级| 岛国av一区二区在线在线观看| 欧美最顶级丰满的aⅴ艳星| 国产国产精品人在线视| 精品国模在线视频| 欧美丰满老妇厨房牲生活| 亚洲免费av网址| 亚洲国产精彩中文乱码av在线播放| 久久精品99久久香蕉国产色戒| 久久免费高清视频| 亚洲成人a**站| 国产精品欧美久久久| 精品动漫一区二区三区| 亚洲精品二三区| 国产亚洲成av人片在线观看桃| 日韩av第一页| 国产999精品久久久影片官网| 97超碰蝌蚪网人人做人人爽| 国产99久久精品一区二区永久免费| 国产裸体写真av一区二区| 久久久爽爽爽美女图片| 欧美性视频精品| 日韩专区在线观看| 亚洲激情成人网| 亚洲区中文字幕| 一区二区三区视频免费| 久99九色视频在线观看| 国产a级全部精品| 亚洲最新视频在线| 亚洲第一天堂av| 欧美色xxxx| 69久久夜色精品国产7777| 日韩视频精品在线| 26uuu另类亚洲欧美日本一| 欧美黑人一区二区三区| 欧美色道久久88综合亚洲精品| 亚洲精品日韩av| 国产精品一区二区三区在线播放| 亚洲最大福利网站| 亚洲精品不卡在线| 97在线视频免费播放| 亚洲人成在线观| 亚洲日本中文字幕| 亚洲美女黄色片| 国产在线视频2019最新视频| 国产成人精品av| 91精品久久久久久久久| 亚洲一区二区久久久久久| 亚洲午夜精品久久久久久久久久久久| 精品成人在线视频| 日韩成人中文电影| 91精品国产综合久久香蕉922| 久久久久久欧美| 亚洲美女又黄又爽在线观看| 国产精品高清免费在线观看| 不卡av电影在线观看| 国产日韩在线亚洲字幕中文| 欧美激情性做爰免费视频| 亚洲2020天天堂在线观看| 国产精品三级久久久久久电影| 91在线直播亚洲| 亚洲最大福利网站| 国产精品久久91| 91色在线视频| 亚洲在线观看视频网站| 欧美专区在线视频| 亚洲黄色在线观看| 69影院欧美专区视频| 成人性生交大片免费观看嘿嘿视频| 亚洲天堂av在线免费观看| 久久久人成影片一区二区三区| 91精品国产777在线观看| 欧美激情va永久在线播放|