ImageVerifierCode 换一换
格式:DOCX , 页数:11 ,大小:16.93KB ,
资源ID:7844122      下载积分:3 金币
快捷下载
登录下载
邮箱/手机:
温馨提示:
快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。 如填写123,账号就是123,密码也是123。
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝    微信支付   
验证码:   换一换

加入VIP,免费下载
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【https://www.bdocx.com/down/7844122.html】到电脑端继续下载(重复下载不扣费)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: 微信登录   QQ登录  

下载须知

1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。
2: 试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。
3: 文件的所有权益归上传用户所有。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 本站仅提供交流平台,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

版权提示 | 免责声明

本文(C语言库函数G类字母2.docx)为本站会员(b****6)主动上传,冰豆网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知冰豆网(发送邮件至service@bdocx.com或直接QQ联系客服),我们立即给予删除!

C语言库函数G类字母2.docx

1、C语言库函数G类字母 2C语言库函数(G类字母) - 2本文出自: 作者: (2001-07-28 08:05:00)函数名: getdate 功 能: 取DOS日期 用 法: void getdate(struct *dateblk); 程序例: #include #include int main(void) struct date d; getdate(&d); printf(The current year is: %dn, d.da_year); printf(The current day is: %dn, d.da_day); printf(The current month i

2、s: %dn, d.da_mon); return 0; 函数名: getdefaultpalette 功 能: 返回调色板定义结构 用 法: struct palettetype *far getdefaultpalette(void); 程序例: #include #include #include #include int main(void) /* request auto detection */ int gdriver = DETECT, gmode, errorcode; int i; /* structure for returning palette copy */ stru

3、ct palettetype far *pal=(void *) 0; /* initialize graphics and local variables */ initgraph(&gdriver, &gmode, ); /* read result of initialization */ errorcode = graphresult(); /* an error occurred */ if (errorcode != grOk) printf(Graphics error: %sn, grapherrormsg(errorcode); printf(Press any key to

4、 halt:); getch(); /* terminate with an error code */ exit(1); setcolor(getmaxcolor(); /* return a pointer to the default palette */ pal = getdefaultpalette(); for (i=0; icolorsi); getch(); /* clean up */ getch(); closegraph(); return 0; 函数名: getdisk 功 能: 取当前磁盘驱动器号 用 法: int getdisk(void); 程序例: #inclu

5、de #include int main(void) int disk; disk = getdisk() + A; printf(The current drive is: %cn, disk); return 0; 函数名: getdrivername 功 能: 返回指向包含当前图形驱动程序名字的字符串指针 用 法: char *getdrivename(void); 程序例: #include #include #include #include int main(void) /* request auto detection */ int gdriver = DETECT, gmode

6、, errorcode; /* stores the device driver name */ char *drivername; /* initialize graphics and local variables */ initgraph(&gdriver, &gmode, ); /* read result of initialization */ errorcode = graphresult(); /* an error occurred */ if (errorcode != grOk) printf(Graphics error: %sn, grapherrormsg(erro

7、rcode); printf(Press any key to halt:); getch(); /* terminate with an error code */ exit(1); setcolor(getmaxcolor(); /* get name of the device driver in use */ drivername = getdrivername(); /* for centering text on the screen */ settextjustify(CENTER_TEXT, CENTER_TEXT); /* output the name of the dri

8、ver */ outtextxy(getmaxx() / 2, getmaxy() / 2, drivername); /* clean up */ getch(); closegraph(); return 0; 函数名: getdta 功 能: 取磁盘传输地址 用 法: char far *getdta(void); 程序例: #include #include int main(void) char far *dta; dta = getdta(); printf(The current disk transfer address is: %Fpn, dta); return 0; 函数

9、名: getenv 功 能: 从环境中取字符串 用 法: char *getenv(char *envvar); 程序例: #include #include int main(void) char *s; s=getenv(COMSPEC); /* get the comspec environment parameter */ printf(Command processor: %sn,s); /* display comspec parameter */ return 0; 函数名: getfat, getfatd 功 能: 取文件分配表信息 用 法: void getfat(int d

10、rive, struct fatinfo *fatblkp); 程序例: #include #include int main(void) struct fatinfo diskinfo; int flag = 0; printf(Please insert disk in drive An); getchar(); getfat(1, &diskinfo); /* get drive information */ printf(nDrive A: is ); switch(unsigned char) diskinfo.fi_fatid) case 0xFD: printf(360K low

11、 densityn); break; case 0xF9: printf(1.2 Meg high densityn); break; default: printf(unformattedn); flag = 1; if (!flag) printf( sectors per cluster %5dn, diskinfo.fi_sclus); printf( number of clusters %5dn, diskinfo.fi_nclus); printf( bytes per sector %5dn, diskinfo.fi_bysec); return 0; 函数名: getfill

12、pattern 功 能: 将用户定义的填充模式拷贝到内存中 用 法: void far getfillpattern(char far *upattern); 程序例: #include #include #include #include int main(void) /* request auto detection */ int gdriver = DETECT, gmode, errorcode; int maxx, maxy; char pattern8 = 0x00, 0x70, 0x20, 0x27, 0x25, 0x27, 0x04, 0x04; /* initialize g

13、raphics and local variables */ initgraph(&gdriver, &gmode, ); /* read result of initialization */ errorcode = graphresult(); if (errorcode != grOk) /* an error occurred */ printf(Graphics error: %sn, grapherrormsg(errorcode); printf(Press any key to halt:); getch(); exit(1); /* terminate with an err

14、or code */ maxx = getmaxx(); maxy = getmaxy(); setcolor(getmaxcolor(); /* select a user defined fill pattern */ setfillpattern(pattern, getmaxcolor(); /* fill the screen with the pattern */ bar(0, 0, maxx, maxy); getch(); /* get the current user defined fill pattern */ getfillpattern(pattern); /* al

15、ter the pattern we grabbed */ pattern4 -= 1; pattern5 -= 3; pattern6 += 3; pattern7 -= 4; /* select our new pattern */ setfillpattern(pattern, getmaxcolor(); /* fill the screen with the new pattern */ bar(0, 0, maxx, maxy); /* clean up */ getch(); closegraph(); return 0; 函数名: getfillsettings 功 能: 取得

16、有关当前填充模式和填充颜色的信息 用 法: void far getfillsettings(struct fillsettingstype far *fillinfo); 程序例: #include #include #include #include / the names of the fill styles supported */ char *fname = EMPTY_FILL, SOLID_FILL, LINE_FILL, LTSLASH_FILL, SLASH_FILL, BKSLASH_FILL, LTBKSLASH_FILL, HATCH_FILL, XHATCH_FILL

17、, INTERLEAVE_FILL, WIDE_DOT_FILL, CLOSE_DOT_FILL, USER_FILL ; int main(void) /* request auto detection */ int gdriver = DETECT, gmode, errorcode; struct fillsettingstype fillinfo; int midx, midy; char patstr40, colstr40; /* initialize graphics and local variables */ initgraph(&gdriver, &gmode, ); /*

18、 read result of initialization */ errorcode = graphresult(); if (errorcode != grOk) /* an error occurred */ printf(Graphics error: %sn, grapherrormsg(errorcode); printf(Press any key to halt:); getch(); exit(1); /* terminate with an error code */ midx = getmaxx() / 2; midy = getmaxy() / 2; /* get in

19、formation about current fill pattern and color */ getfillsettings(&fillinfo); /* convert fill information into strings */ sprintf(patstr, %s is the fill style., fnamefillinfo.pattern); sprintf(colstr, %d is the fill color., fillinfo.color); /* display the information */ settextjustify(CENTER_TEXT, C

20、ENTER_TEXT); outtextxy(midx, midy, patstr); outtextxy(midx, midy+2*textheight(W), colstr); /* clean up */ getch(); closegraph(); return 0; 函数名: getftime 功 能: 取文件日期和时间 用 法: int getftime(int handle, struct ftime *ftimep); 程序例: #include #include int main(void) FILE *stream; struct ftime ft; if (stream

21、= fopen(TEST.$, wt) = NULL) fprintf(stderr, Cannot open output file.n); return 1; getftime(fileno(stream), &ft); printf(File time: %u:%u:%un, ft.ft_hour, ft.ft_min, ft.ft_tsec * 2); printf(File date: %u/%u/%un, ft.ft_month, ft.ft_day, ft.ft_year+1980); fclose(stream); return 0; 函数名: getgraphmode 功 能

22、: 返回当前图形模式 用 法: int far getgraphmode(void); 程序例: #include #include #include #include int main(void) /* request auto detection */ int gdriver = DETECT, gmode, errorcode; int midx, midy, mode; char numname80, modename80; /* initialize graphics and local variables */ initgraph(&gdriver, &gmode, ); /* r

23、ead result of initialization */ errorcode = graphresult(); /* an error occurred */ if (errorcode != grOk) printf(Graphics error: %sn, grapherrormsg(errorcode); printf(Press any key to halt:); getch(); /* terminate with an error code */ exit(1); midx = getmaxx() / 2; midy = getmaxy() / 2; /* get mode

24、 number and name strings */ mode = getgraphmode(); sprintf(numname, %d is the current mode number., mode); sprintf(modename, %s is the current graphics mode, getmodename(mode); /* display the information */ settextjustify(CENTER_TEXT, CENTER_TEXT); outtextxy(midx, midy, numname); outtextxy(midx, mid

25、y+2*textheight(W), modename); /* clean up */ getch(); closegraph(); return 0; 函数名: getftime 功 能: 取文件日期和时间 用 法: int getftime(int handle, struct ftime *ftimep); 程序例: #include #include int main(void) FILE *stream; struct ftime ft; if (stream = fopen(TEST.$, wt) = NULL) fprintf(stderr, Cannot open output file.n); return 1; getftime(fileno(stream), &ft); printf(File time: %u:%u:%un, ft.ft_hour, ft.ft_min, ft.ft_tsec * 2); printf(File date: %u/%u/%un, ft.ft_month, ft.ft_day, ft.ft_year+1980); fclose(stream); return 0;

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1