错误: BGI:Graphics not initializd (use 'initgraph')

#include <graphics.h> 
main() 

int graphdriver=DETECT; 
int graphmode,x; 
initgraph(&graphdriver,&graphmode,””); 
cleardevice(); 
rectangle(100,20,200,50); 
bar(100,80,150,180)5 
getch(); 
closegraph(); 


以上是程序,附错误如下: 
BGI:Graphics not initializd (use 'initgraph') 
如何解决阿,请教。
TC下有个BGI.arc文件

元芳怎么了
浏览 113回答 2
2回答

胡说叔叔

图形函数裙化错误了,正确的应该如下:#include <graphics.h>&nbsp;main()&nbsp;{&nbsp;int graphdriver=DETECT;&nbsp;int graphmode,x;&nbsp;initgraph(&gdriver,&gmode,””);(就这一行)&nbsp;cleardevice();&nbsp;rectangle(100,20,200,50);&nbsp;bar(100,80,150,180);getch();&nbsp;closegraph();&nbsp;}

撒科打诨

加上真实的BGI路径再试。initgraph(&graphdriver,&graphmode,”c:\\tc\\bgi”);
打开App,查看更多内容
随时随地看视频慕课网APP