<>函数名: closegraph
功 能: 关闭图形系统
用 法: void far closegraph(void);
程序例: <>#include <graphics.h>
#include <stdlib.h>
#include <stdio.h>
#include <conio.h> <>int main(void)
{
/* request auto detection */
int gdriver = DETECT, gmode, errorcode;
int x, y; <P> /* initialize graphics mode */
initgraph(&gdriver, &gmode, ""); <P> /* read result of initialization */
errorcode = graphresult(); <P> 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 */
} <P> x = getmaxx() / 2;
y = getmaxy() / 2; <P> /* output a message */
settextjustify(CENTER_TEXT, CENTER_TEXT);
outtextxy(x, y, "Press a key to close the graphics system:"); <P> /* wait for a key */
getch(); <P> /* closes down the graphics system */
closegraph(); <P> printf("We're now back in text mode.\n");
printf("Press any key to halt:");
getch();
return 0;
}
<>函数名: clreol
功 能: 在文本窗口中清除字符到行末
用 法: void clreol(void);
程序例: <>#include <conio.h> <>int main(void) <P>{
clrscr();
cprintf("The function CLREOL clears all characters from the\r\n");
cprintf("cursor position to the end of the line within the\r\n");
cprintf("current text window, without moving the cursor.\r\n");
cprintf("Press any key to continue . . .");
gotoxy(14, 4);
getch(); <P> clreol();
getch(); <P> return 0;
}
<>函数名: country
功 能: 返回与国家有关的信息
用 法: struct COUNTRY *country(int countrycode, struct country *country);
程序例: <>#include <dos.h>
#include <stdio.h> <>#define USA 0 <P>int main(void)
{
struct COUNTRY country_info; <P> country(USA, &country_info);
printf("The currency symbol for the USA is: %s\n",
country_info.co_curr);
return 0;
}
</P>