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

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

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

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

函數名: bar
功 能: 畫一個二維條形圖
用 法: void far bar(int left, int top, int right, int bottom);
程序例:
#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, i; /* initialize graphics and local variables */
initgraph(&gdriver, &gmode, ""); /* read result of initialization */
errorcode = graphresult();
if (errorcode != grOk) /* an error occurred */
{
printf("Press any key to halt:");
getch();
exit(1); /* terminate with an error code */
} midx = getmaxx() / 2;
midy = getmaxy() / 2; /* loop through the fill patterns */
for (i=SOLID_FILL; i<USER_FILL; i++)
{
/* set the fill style */
setfillstyle(i, getmaxcolor()); /* draw the bar */
bar(midx-50, midy-50, midx+50,
midy+50); getch();
} /* clean up */
closegraph();
return 0;
}
函數名: bar3d
功 能: 畫一個三維條形圖
用 法: void far bar3d(int left, int top, int right, int bottom,
int depth, int topflag);
程序例: #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, i; /* initialize graphics, 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();
exit(1); /* terminate with error code */
} midx = getmaxx() / 2;
midy = getmaxy() / 2; /* loop through the fill patterns */
for (i=EMPTY_FILL; i<USER_FILL; i++)
{
/* set the fill style */
setfillstyle(i, getmaxcolor()); /* draw the 3-d bar */
bar3d(midx-50, midy-50, midx+50, midy+50, 10, 1); getch();
} /* clean up */
closegraph();
return 0;
}
函數名: bdos
功 能: DOS系統調用
用 法: int bdos(int dosfun, unsigned dosdx, unsigned dosal);
程序例: #include <stdio.h>
#include <dos.h> /* Get current drive as 'A', 'B', ... */
char current_drive(void)
{
char curdrive; /* Get current disk as 0, 1, ... */
curdrive = bdos(0x19, 0, 0);
return('A' + curdrive);
} int main(void)
{
printf("The current drive is %c:/n", current_drive());
return 0;
}
函數名: bdosptr
功 能: DOS系統調用
用 法: int bdosptr(int dosfun, void *argument, unsigned dosal);
程序例: #include <string.h>

#include <stdio.h>
#include <dir.h>
#include <dos.h>
#include <errno.h>
#include <stdlib.h> #define BUFLEN 80 int main(void)
{
char buffer[BUFLEN];
int test; printf("Enter full pathname of a Directory/n");
gets(buffer); test = bdosptr(0x3B,buffer,0);
if(test)
{
printf("DOS error message: %d/n", errno);
/* See errno.h for error listings */
exit (1);
} getcwd(buffer, BUFLEN);
printf("The current directory is: %s/n", buffer); return 0;
}
函數名: bioscom
功 能: 串行I/O通信
用 法: int bioscom(int cmd, char abyte, int port);
程序例: #include <bios.h>
#include <conio.h> #define COM1 0
#define DATA_READY 0x100
#define TRUE 1
#define FALSE 0 #define SETTINGS ( 0x80 0x02 0x00 0x00) int main(void)
{
int in, out, status, DONE = FALSE; bioscom(0, SETTINGS, COM1);
cprintf("... BIOSCOM [ESC] to exit .../n");
while (!DONE)
{
status = bioscom(3, 0, COM1);
if (status & DATA_READY)
if ((out = bioscom(2, 0, COM1) & 0x7F) != 0)
putch(out);
if (kbhit())
{
if ((in = getch()) == '/x1B')
DONE = TRUE;
bioscom(1, in, COM1);
}
}
return 0;
}
函數名: biosdisk
功 能: 軟硬盤I/O
用 法: int biosdisk(int cmd, int drive, int head, int track, int sector
int nsects, void *buffer);
程序例: #include <bios.h>
#include <stdio.h> int main(void)
{
int result;
char buffer[512]; printf("Testing to see if drive a: is ready/n");
result = biosdisk(4,0,0,0,0,1,buffer);
result &= 0x02;
(result) ? (printf("Drive A: Ready/n")) :
(printf("Drive A: Not Ready/n")); return 0;
}
函數名: biosequ
ip
功 能: 檢查設備
用 法: int biosequip(void);
程序例: #include <bios.h>
#include <stdio.h> int main(void)
{
int result;
char buffer[512]; printf("Testing to see if drive a: is ready/n");
result = biosdisk(4,0,0,0,0,1,buffer);
result &= 0x02;
(result) ? (printf("Drive A: Ready/n")) :
(printf("Drive A: Not Ready/n")); return 0;
}
函數名: bioskey
功 能: 直接使用BIOS服務的鍵盤接口
用 法: int bioskey(int cmd);
程序例: #include <stdio.h>
#include <bios.h>
#include <ctype.h> #define RIGHT 0x01
#define LEFT 0x02
#define CTRL 0x04
#define ALT 0x08 int main(void)
{
int key, modifiers; /* function 1 returns 0 until a key is pressed */
while (bioskey(1) == 0); /* function 0 returns the key that is waiting */
key = bioskey(0); /* use function 2 to determine if shift keys were used */

modifiers = bioskey(2);
if (modifiers)
{
printf("[");
if (modifiers & RIGHT) printf("RIGHT");
if (modifiers & LEFT) printf("LEFT");
if (modifiers & CTRL) printf("CTRL");
if (modifiers & ALT) printf("ALT");
printf("]");
}
/* print out the character read */
if (isalnum(key & 0xFF))
printf("'%c'/n", key);
else
printf("%#02x/n", key);
return 0;
} 函數名: biosmemory
功 能: 返回存儲塊大小
用 法:int biosmemory(void);
程序例: #include <stdio.h>
#include <bios.h> int main(void)
{
int memory_size; memory_size = biosmemory(); /* returns value up to 640K */
printf("RAM size = %dK/n",memory_size);
return 0;
}
函數名: biosprint
功 能: 直接使用BIOS服務的打印機I/O
用 法: int biosprint(int cmd, int byte, int port);
程序例: #include <stdio.h>
#include <conio.h>
#include <bios.h> int main(void)
{
#define STATUS 2 /* printer status command */
#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 & 0x01)
printf("Device time out./n");
if (status & 0x08)
printf("I/O error./n"); if (status & 0x10)
printf("Selected./n");
if (status & 0x20)
printf("Out of paper./n"); if (status & 0x40)
printf("Acknowledge./n");
if (status & 0x80)
printf("Not busy./n"); return 0;
}
函數名: biostime
功 能: 讀取或設置BIOS時間
用 法: long biostime(int cmd, long newtime);
程序例: #include <stdio.h>
#include <bios.h>
#include <time.h>
#include <conio.h> 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;
}
函數名: brk
功 能: 改變數據段空間分配
用 法: int brk(void *endds);
程序例: #include <stdio.h>
#include <alloc.h> 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;
}
函數名: bsearch
功 能: 二分法搜索
用 法: void *bsearch(const void *key, const void *base, size_t *nelem,
size_t width, int(*fcmp)(const void *, const *));
程序例: #include <stdlib.h>
#include <stdio.h> #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
compile time */
itemptr = bsearch (&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 isn't in the table./n"); return 0;
}











發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
亚洲香蕉成人av网站在线观看_欧美精品成人91久久久久久久_久久久久久久久久久亚洲_热久久视久久精品18亚洲精品_国产精自产拍久久久久久_亚洲色图国产精品_91精品国产网站_中文字幕欧美日韩精品_国产精品久久久久久亚洲调教_国产精品久久一区_性夜试看影院91社区_97在线观看视频国产_68精品久久久久久欧美_欧美精品在线观看_国产精品一区二区久久精品_欧美老女人bb
国产精品永久在线| 欧美在线视频a| 久久影院模特热| 国产v综合v亚洲欧美久久| 亚洲女人天堂视频| 国产精品中文字幕久久久| 亚洲精品一区二区网址| 亚洲精品有码在线| 日韩高清人体午夜| 一级做a爰片久久毛片美女图片| 欧美激情久久久久久| 超碰精品一区二区三区乱码| 国产欧美中文字幕| 欧美精品www在线观看| 国产美女精彩久久| 国产精品视频网| 欧美日韩免费网站| 欧美尤物巨大精品爽| 97久久精品人搡人人玩| 中文日韩电影网站| 中文字幕在线看视频国产欧美在线看完整| 亚洲第五色综合网| 亚洲欧洲av一区二区| 色香阁99久久精品久久久| 91精品国产综合久久香蕉922| 久久久亚洲精选| 国产精品自拍小视频| 欧美一区二区三区免费观看| 九九九热精品免费视频观看网站| 国产精品青草久久久久福利99| 精品久久香蕉国产线看观看亚洲| 狠狠色香婷婷久久亚洲精品| 国产视频在线观看一区二区| 欧美日韩在线免费观看| 国产精品久久久久久久久久小说| 在线丨暗呦小u女国产精品| 精品女同一区二区三区在线播放| 欧美国产日韩中文字幕在线| 日本亚洲欧洲色| 亚洲一区二区三区成人在线视频精品| 久久婷婷国产麻豆91天堂| 精品久久在线播放| 久久伊人精品一区二区三区| 欧美性生交大片免网| 亚洲欧美激情视频| 粉嫩av一区二区三区免费野| 成人欧美一区二区三区黑人孕妇| 精品久久久久国产| 亚洲精品久久久久中文字幕欢迎你| 国产一区二区三区在线免费观看| 韩国一区二区电影| 日本免费一区二区三区视频观看| 欧美性xxxx在线播放| 91在线视频精品| 日韩一区二区福利| 国产午夜精品全部视频在线播放| 欧美一区二区视频97| 精品久久久一区| 伊人一区二区三区久久精品| 国产91精品久久久| 日韩中文字幕在线视频| 激情懂色av一区av二区av| 亚洲成avwww人| 国产精品福利在线观看网址| 91精品国产高清久久久久久91| 国产精品久久在线观看| 国产午夜精品一区理论片飘花| 97精品在线视频| 日韩精品电影网| 久久精品国产久精国产一老狼| 国产欧美日韩精品专区| 亚洲午夜久久久久久久| 中文字幕亚洲色图| 欧美极品美女视频网站在线观看免费| 日韩免费av片在线观看| 久久久在线免费观看| 亚洲xxx视频| 亚洲qvod图片区电影| 久久综合五月天| 日韩av影视在线| 国产99久久久欧美黑人| 亚洲色图15p| 久久成人人人人精品欧| 午夜精品蜜臀一区二区三区免费| 久久精品美女视频网站| 91在线观看免费观看| 亚洲国模精品私拍| 亚洲精品日韩激情在线电影| 亚洲免费成人av电影| 一区二区三区亚洲| 久久久av电影| 成人免费网站在线观看| 亚洲国产精久久久久久久| 另类天堂视频在线观看| 日韩暖暖在线视频| 欧美日韩成人在线视频| 国产精品久久一区主播| 国产精品美乳一区二区免费| 国产91精品不卡视频| 欧美巨乳在线观看| 68精品国产免费久久久久久婷婷| 久久久久999| 亚洲自拍偷拍福利| 日韩激情视频在线| 亚洲欧美视频在线| 欧美激情视频在线免费观看 欧美视频免费一| 久久久久久久亚洲精品| 一区二区亚洲精品国产| 91香蕉嫩草神马影院在线观看| 亚洲女人初尝黑人巨大| 久久久久久久久国产| 91国产精品视频在线| 亚洲情综合五月天| 国产成人精品国内自产拍免费看| 欧美人在线视频| 777国产偷窥盗摄精品视频| 97国产suv精品一区二区62| 少妇高潮久久77777| 久久久91精品国产| 日韩网站免费观看| 国产成人免费91av在线| 91精品国产色综合久久不卡98口| 日韩中文字幕在线| 欧美中文在线免费| 欧美电影在线观看| 555www成人网| 4438全国成人免费| 亚洲а∨天堂久久精品喷水| 日韩欧美精品免费在线| www.亚洲免费视频| 久久成人一区二区| 久久人人爽国产| 色综合久久久久久中文网| 国产精品久久综合av爱欲tv| 欧美贵妇videos办公室| 欧美精品福利视频| 懂色aⅴ精品一区二区三区蜜月| 性夜试看影院91社区| 亚洲欧美日韩一区在线| 91亚洲国产成人精品性色| 91免费在线视频| 精品呦交小u女在线| 亚洲欧美日韩中文在线| 亚洲成av人影院在线观看| 国产精品国产三级国产专播精品人| 97精品视频在线| 4438全国成人免费| 成人免费大片黄在线播放| 亚洲国内精品视频| 91久久久精品| 欧美在线视频观看免费网站| 欧美精品videosex极品1| 国产999精品| 亚洲一区二区三区777| 亚洲精品久久久一区二区三区| 日本精品一区二区三区在线播放视频| 欧美激情一区二区三级高清视频| 全色精品综合影院| 夜夜狂射影院欧美极品| 亚洲久久久久久久久久久| 日韩欧美一区二区三区| 国产精品久久久久久久久久尿| 国产亚洲精品综合一区91| 国产精品看片资源|