两处分别是error C2065: 'settextstyle' : undeclared identifier 和 error C2065: 'HORIZ_DIR' : undeclared identifier
执行 cl.exe 时出错.
#include <graphics.h>
#include <conio.h>
#include <stdio.h>
void main()
{
int driver=DETECT,mode;
int x1=200,y1=150,x2=100,y2=300,x3=550;
initgraph(&driver,&mode,"");
setcolor(WHITE);
settextstyle(3,0,3);
outtextxy(x1+125,y2+5,"c");
settextstyle(1,HORIZ_DIR,4);
setcolor(WHITE);
outtextxy(70,40,"find the center c:");
setcolor(YELLOW);
outtextxy(72,42,"find the center c:");
setcolor(RED);
outtextxy(71,41,"find the center c:");
line(x1,y1,x2,y2);
moveto(x1,y1);
lineto(x3,y2);
lineto(x2,y2);
moveto(x1,y1);
setlinestyle(3,0,1);
linerel(x3-x1-(x3-x2)/2,y2-y1);
getch();
closegraph();
}