C语言中的画图函数,在VC++6.0中怎么不能运行??????

来源:百度知道 编辑:UC知道 时间:2024/06/17 14:44:54
程序如下:

#include<graphics.h>
main()
{int gdriver=DETECT,gmode;
initgraph(&gdriver,&gmode,"c:\\tc");
cleardevice();
moveto(160,120);
lineto(480,120);
lineto(160,360);
lineto(160120);
getch();
closegraph();
}

运行结果如下:

ompiling...
画矩形.cpp
f:\画矩形.cpp(1) : fatal error C1083: Cannot open include file: 'graphics.h': No such file or directory
Error executing cl.exe.

画矩形.exe - 1 error(s), 0 warning(s)

VC中没有graphics.h,TC可以,要用VC的话就要学MFC的GDI有关的类,相应的类封装了画图要用的函数

graphics.h
vc里面没有这个头文件的
最好有tc2.0试试。。tc里很多函数和头文件在vc里是不被包含的。。

VC把这些函数集成在MFC里面了

vc里没有graphics

VC中没有这个头文件,可以用TC编译

编译这个代码之前,先安装easyx库,然后就会有graphics.h头文件,就能完美编译执行。