c程序运行时画图库函数出现问题,不知怎么解决???
这里有一个c程序,在tc和vc中运行都不能得到正确结果,还请哪位高手帮助解决一下,在下先行谢过!#include<stdio.h>#include<graphics.h>...
这里有一个c程序,在tc和vc中运行都不能得到正确结果,还请哪位高手帮助解决一下,在下先行谢过!
#include<stdio.h>
#include<graphics.h>
void main ()
{ int cb,cf;
int gdriver=DETECT,gmode;
initgraph(&gdriver,&gmode,"C:\\Program Files\Microsoft Visual Studio");
cleardevice();
printf(" \n this program shows how to set color of graph!");
printf("\n press any key to change color");
for(cb=0;cb<=15;cb++)
{ setbkcolor(cb);
for(cf=0;cf<=15;cf++)
{ setcolor(cf);
} circle(100+cf*25,240,100);
getch();
}
getch();
closegraph();
}
在vc中运行时出现打不开graphics.h文件,从tc中拷了一个graphics.h放到vc的include中后还是不能用,在tc中运行时出现的结果
BGI Error: Graphics not initialized (use'initgraph')
还请那位C语言高手给与解决,谢谢!!!! 展开
#include<stdio.h>
#include<graphics.h>
void main ()
{ int cb,cf;
int gdriver=DETECT,gmode;
initgraph(&gdriver,&gmode,"C:\\Program Files\Microsoft Visual Studio");
cleardevice();
printf(" \n this program shows how to set color of graph!");
printf("\n press any key to change color");
for(cb=0;cb<=15;cb++)
{ setbkcolor(cb);
for(cf=0;cf<=15;cf++)
{ setcolor(cf);
} circle(100+cf*25,240,100);
getch();
}
getch();
closegraph();
}
在vc中运行时出现打不开graphics.h文件,从tc中拷了一个graphics.h放到vc的include中后还是不能用,在tc中运行时出现的结果
BGI Error: Graphics not initialized (use'initgraph')
还请那位C语言高手给与解决,谢谢!!!! 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询