#include <graphics.h>
#include <stdlib.h>
#include <stdio.h>
#include <conio.h> int main(void)
{
/* 要求 auto 检查 */
int gdriver = DETECT, gmode, errorcode;
int midx, midy;
int stangle = 45, endangle = 135;
int radius = 100; /*初始化图形和局部变量 */
initgraph(&gdriver, &gmode, ""); /* 读取结果的初始化 */
errorcode = graphresult(); /* an error occurred */
if (errorcode != grOk)
{
printf("Graphics error: %s\n", grapherrormsg(errorcode));
printf("Press any key to halt:");
getch(); exit(1); /* 终止错误码 */
} midx = getmaxx() / 2;
midy = getmaxy() / 2;
setcolor(getmaxcolor()); /* draw arc */
arc(midx, midy, stangle, endangle, radius); /* clean up */
getch();
closegraph();
return 0;
}
--------------------Configuration: GG - Win32 Debug--------------------
Compiling...
GG.CPP
f:\c程序\gg\gg.cpp(1) : fatal error C1083: Cannot open include file: 'graphics.h': No such file or directory
执行 cl.exe 时出错. GG.OBJ - 1 error(s), 0 warning(s)
#include <stdlib.h>
#include <stdio.h>
#include <conio.h> int main(void)
{
/* 要求 auto 检查 */
int gdriver = DETECT, gmode, errorcode;
int midx, midy;
int stangle = 45, endangle = 135;
int radius = 100; /*初始化图形和局部变量 */
initgraph(&gdriver, &gmode, ""); /* 读取结果的初始化 */
errorcode = graphresult(); /* an error occurred */
if (errorcode != grOk)
{
printf("Graphics error: %s\n", grapherrormsg(errorcode));
printf("Press any key to halt:");
getch(); exit(1); /* 终止错误码 */
} midx = getmaxx() / 2;
midy = getmaxy() / 2;
setcolor(getmaxcolor()); /* draw arc */
arc(midx, midy, stangle, endangle, radius); /* clean up */
getch();
closegraph();
return 0;
}
--------------------Configuration: GG - Win32 Debug--------------------
Compiling...
GG.CPP
f:\c程序\gg\gg.cpp(1) : fatal error C1083: Cannot open include file: 'graphics.h': No such file or directory
执行 cl.exe 时出错. GG.OBJ - 1 error(s), 0 warning(s)
