C语言库函数G类字母2Word格式文档下载.docx

上传人:b****6 文档编号:20973568 上传时间:2023-01-26 格式:DOCX 页数:11 大小:16.93KB
下载 相关 举报
C语言库函数G类字母2Word格式文档下载.docx_第1页
第1页 / 共11页
C语言库函数G类字母2Word格式文档下载.docx_第2页
第2页 / 共11页
C语言库函数G类字母2Word格式文档下载.docx_第3页
第3页 / 共11页
C语言库函数G类字母2Word格式文档下载.docx_第4页
第4页 / 共11页
C语言库函数G类字母2Word格式文档下载.docx_第5页
第5页 / 共11页
点击查看更多>>
下载资源
资源描述

C语言库函数G类字母2Word格式文档下载.docx

《C语言库函数G类字母2Word格式文档下载.docx》由会员分享,可在线阅读,更多相关《C语言库函数G类字母2Word格式文档下载.docx(11页珍藏版)》请在冰豆网上搜索。

C语言库函数G类字母2Word格式文档下载.docx

%d\n"

d.da_year);

Thecurrentdayis:

d.da_day);

Thecurrentmonthis:

d.da_mon);

return0;

}

getdefaultpalette

返回调色板定义结构

structpalettetype*fargetdefaultpalette(void);

graphics.h>

stdlib.h>

conio.h>

/*requestautodetection*/

intgdriver=DETECT,gmode,errorcode;

inti;

/*structureforreturningpalettecopy*/

structpalettetypefar*pal=(void*)0;

/*initializegraphicsandlocalvariables*/

initgraph(&

gdriver,&

gmode,"

"

);

/*readresultofinitialization*/

errorcode=graphresult();

/*anerroroccurred*/

if(errorcode!

=grOk)

Graphicserror:

%s\n"

grapherrormsg(errorcode));

Pressanykeytohalt:

getch();

/*terminatewithanerrorcode*/

exit

(1);

setcolor(getmaxcolor());

/*returnapointertothedefaultpalette*/

pal=getdefaultpalette();

for(i=0;

i<

16;

i++)

colors[%d]=%d\n"

i,

pal->

colors[i]);

/*cleanup*/

closegraph();

getdisk

取当前磁盘驱动器号

intgetdisk(void);

dir.h>

intdisk;

disk=getdisk()+'

A'

;

Thecurrentdriveis:

%c\n"

disk);

getdrivername

返回指向包含当前图形驱动程序名字的字符串指针

char*getdrivename(void);

/*storesthedevicedrivername*/

char*drivername;

/*getnameofthedevicedriverinuse*/

drivername=getdrivername();

/*forcenteringtextonthescreen*/

settextjustify(CENTER_TEXT,CENTER_TEXT);

/*outputthenameofthedriver*/

outtextxy(getmaxx()/2,getmaxy()/2,

drivername);

getdta

取磁盘传输地址

charfar*getdta(void);

charfar*dta;

dta=getdta();

Thecurrentdisktransfer\

addressis:

%Fp\n"

dta);

getenv

从环境中取字符串

char*getenv(char*envvar);

char*s;

s=getenv("

COMSPEC"

/*getthecomspecenvironmentparameter*/

Commandprocessor:

s);

/*displaycomspecparameter*/

getfat,getfatd

取文件分配表信息

voidgetfat(intdrive,structfatinfo*fatblkp);

structfatinfodiskinfo;

intflag=0;

PleaseinsertdiskindriveA\n"

getchar();

getfat(1,&

diskinfo);

/*getdriveinformation*/

\nDriveA:

is"

switch((unsignedchar)diskinfo.fi_fatid)

case0xFD:

360Klowdensity\n"

break;

case0xF9:

1.2Meghighdensity\n"

default:

unformatted\n"

flag=1;

if(!

flag)

sectorspercluster%5d\n"

diskinfo.fi_sclus);

numberofclusters%5d\n"

diskinfo.fi_nclus);

bytespersector%5d\n"

diskinfo.fi_bysec);

getfillpattern

将用户定义的填充模式拷贝到内存中

voidfargetfillpattern(charfar*upattern);

intmaxx,maxy;

charpattern[8]={0x00,0x70,0x20,0x27,0x25,0x27,0x04,0x04};

=grOk)/*anerroroccurred*/

grapherrormsg(errorcode));

/*terminatewithanerrorcode*/

maxx=getmaxx();

maxy=getmaxy();

/*selectauserdefinedfillpattern*/

setfillpattern(pattern,getmaxcolor());

/*fillthescreenwiththepattern*/

bar(0,0,maxx,maxy);

/*getthecurrentuserdefinedfillpattern*/

getfillpattern(pattern);

/*alterthepatternwegrabbed*/

pattern[4]-=1;

pattern[5]-=3;

pattern[6]+=3;

pattern[7]-=4;

/*selectournewpattern*/

/*fillthescreenwiththenewpattern*/

getfillsettings

取得有关当前填充模式和填充颜色的信息

voidfargetfillsettings(structfillsettingstypefar*fillinfo);

/thenamesofthefillstylessupported*/

char*fname[]={"

EMPTY_FILL"

SOLID_FILL"

LINE_FILL"

LTSLASH_FILL"

SLASH_FILL"

BKSLASH_FILL"

LTBKSLASH_FILL"

HATCH_FILL"

XHATCH_FILL"

INTERLEAVE_FILL"

WIDE_DOT_FILL"

CLOSE_DOT_FILL"

USER_FILL"

};

structfillsettingstypefillinfo;

intmidx,midy;

charpatstr[40],colstr[40];

midx=getmaxx()/2;

midy=getmaxy()/2;

/*getinformationaboutcurrentfillpatternandcolor*/

getfillsettings(&

fillinfo);

/*convertfillinformationintostrings*/

sprintf(patstr,"

%sisthefillstyle."

fname[fillinfo.pattern]);

sprintf(colstr,"

%disthefillcolor."

fillinfo.color);

/*displaytheinformation*/

outtextxy(midx,midy,patstr);

outtextxy(midx,midy+2*textheight("

W"

),colstr);

getftime

取文件日期和时间

intgetftime(inthandle,structftime*ftimep);

io.h>

FILE*stream;

structftimeft;

if((stream=fopen("

TEST.$$$"

wt"

))==NULL)

fprintf(stderr,

Cannotopenoutputfile.\n"

return1;

getftime(fileno(stream),&

ft);

Filetime:

%u:

%u:

%u\n"

ft.ft_hour,ft.ft_min,

ft.ft_tsec*2);

Filedate:

%u/%u/%u\n"

ft.ft_month,ft.ft_day,

ft.ft_year+1980);

fclose(stream);

getgraphmode

返回当前图形模式

intfargetgraphmode(void);

intmidx,midy,mode;

charnumname[80],modename[80];

/*getmodenumberandnamestrings*/

mode=getgraphmode();

sprintf(numname,

%disthecurrentmodenumber."

mode);

sprintf(modename,

%sisthecurrentgraphicsmode"

getmodename(mode));

outtextxy(midx,midy,numname);

),

modename);

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > PPT模板 > 节日庆典

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

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