关于图形驱动!
我把驱动文件放在源代码同一个目录下,代码如下:#include<graphics.h>
int main(void)
{
int gdriver,gmode;
gdriver=DETECT;
initgraph(&gdriver,&gmode,"");
line(100,100,200,200);
line(200,200,100,300);
line(100,300,0,200);
line(0,200,100,100);
line(0,200,200,200);
line(100,100,100,300);
getch();
closegraph();
return 0;
}
结果Win-TC下运行正常,画出一个正方形,
但在TC下却运行时报错:BGI Error:Graphics not initialized(use 'initgraph')
我又在代码所在目录下见了一个文件夹driver,把驱动文件放进去,代码改成:
#include<graphics.h>
int main(void)
{
int gdriver,gmode;
gdriver=DETECT;
initgraph(&gdriver,&gmode,"\driver");
line(100,100,200,200);
line(200,200,100,300);
line(100,300,0,200);
line(0,200,100,100);
line(0,200,200,200);
line(100,100,100,300);
getch();
closegraph();
return 0;
}
结果TC和Win-TC都不行了
哪位知道是怎么回事啊?
多谢!