[求助]关于circle的的错误,莫名其妙的
大一新生,刚学c,碰到个画图问题,我用的是TURBOC2,编译过程中出的错误在程序上说明了.......#include"graphics.h"
#include"math.h"
#include"dos.h"
#include"conio.h"
#include"stdio.h"
#include"stdlib.h"
#include"stdarg.h"
#define MAXPTS 15
#define PI 3.1415926
struct PTS {
int x,y;
}
double AspectRatdio=0.85; <<<===提示“too many types in declaration”
void LineToDemo(void)
{
struct viewporttype vp;
struct PTS points[MAXPTS];
int i,j,h,w,xcenter,ycenter;
int radius,angle,step;
double rads;
printf("MoveTo / LineTo Demonstration");
getviewsettings(&vp);
h=vp.bottom - vp.top;
w=vp.right - vp.left;
xcenter = w / 2;
ycenter = h / 2;
radius = (h-30) / (AspectRatdio*2);
step = 360 / MAXPTS;
angle = 0;
for (i=0 ; i<MAXPTS ; ++i)
rads = (double)angle * PI / 180.0;
points[i].x = xcenter + (int)(cos(rads) * radius);
points[i].y = ycenter - (int)(sin(rads) * radius * AspectRatdio);
angle += step;
}
circle( xcenter , ycenter , radius ); <<<===提示“ type mismatch in redeclaration of 'circle'”
for( i=0 ; i<MAXPTS ; ++i){ <<<=== 提示“declaration syntax error in function circle”
for( j=i ; j<MAXPTS ; ++j){
moveto(points[i].x,points[i].y);
lineto(points[j].x,points[j].y);
}}} <<<===提示“ parameter 'radius' is nerver used in function circle ”
main()
{
int driver,mode;
driver=CGA;mode=CGAC0;
initgraph(&driver,&mode,"");
setcolor(3);
setbkcolor(GREEN);
LineToDemo();
}
我不明白错在什么地方了.........奇怪......