Dev-cpp的库里面怎么没有graphics.h??
很多画图,或者是包含graphics.h的程序用Dev-cpp编译的时候就不能通过,
但是用TC或者是VC就能通过,怎么会这样的???
下面的代码是个简单的画图程序,在TC下可以通过编译,但是用Dev-cpp就不行
#include<graphics.h>
#include<math.h>
main()
{
int x1,x2,y1,y2;
int x0,y0;
float x,y;
int dx,dy;
int ax,ay;
int color=CYAN;
int steps;
float xin,yin;
int i;
int driver=DETECT,mode;
driver=VGA;
mode=VGAHI;
printf("\nPlease input the points:(x1,y1),(x2,y2)\n");
scanf("%d%d%d%d",&x1,&y1,&x2,&y2);
dx=x2-x1;
dy=y2-y1;
ax=abs(dx);
ay=abs(dy);
steps=(ax>ay)?ax:ay;
xin=(float)dx/steps;
yin=(float)dy/steps;
x=x1;
y=y1;
initgraph(&driver,&mode,"d:\\tc");
printf("\nsteps=%d,xin=%f,yin=%f\n",steps,xin,yin);
getch();
cleardevice();
setbkcolor(RED);
for(i=1;i<=steps;i++)
{
x0=(int)x;
y0=(int)y;
putpixel(x0,y0,color);
x=x+xin;
y=y+yin;
}
getch();
closegraph();
}
高手请说说:))