I just looked at your original error statement. Since you are working in 'C' AND_NOT 'C++',(try and give a guy a hint, hmmph)get rid of the: 'class car{' and make a more ordered struct, including only the constants and variables, and no functions.
Like:
struct spCar{
int spX;
int spY;
}
struct edgeLine{
spCar strtPT1;
spCar strtPT2;
}
struct theShape{
edgeLine line1;
edgeLine line2;
edgeLine line3;
edgeLine line4;
}
enum Shape{line, angle, triangle, rectangle, square, ...};
edgeLine L1, L2, L3, L4, L5, L6, L7, L8;
spCar pt1, pt2, pt3, pt4, pt5, pt6, pt7, pt8;
bool SetPoints(int nShape)
{
switch(nShape)
{
case square:
pt1.spX = 75;
pt1.spY = 375;
pt2.spX = 75;
pt2.spY = 345;
pt3.spX = 125;
pt3.spY = 300;
pt4.spX = 225;
pt4.spY = 330;
pt5.spX = 275;
pt5.spY = 345;
pt6.spX = 300;
pt6.spY = 350;
break;
....
}
return true;
}
void drawShape(int shpNum, int nColor)
{
setcolor(nColor);
switch(shpNum)
{
case square:
SetPoints(4, square);
L1={pt1,pt2}; L2={pt2,pt3}; L3={pt3,pt4}; L4={pt4,pt1};
line(L1);
line(L2);
line(L3);
line(L4);
break;
case 1:
line();
line();
line();
line();
break;
}
}
Then you could put other variables or static const type data in it as if needed.
Then next a Graphics function:
void DrawCar(spCar car, int nColor, int shpNum)
{
setcolor(nColor);
pieslice(100,400,40,10,25);
arc((car.spX, car.spY = 75),90,190,30);
circle(100,400,25);
drawShape(shpNum,nColor);
}
Rewrite your move function:
void move_sp(int a, spCar car, int shpNum)
{
for(int i = 0; i < = 20; i++)
{
car.spX += a;
car.spY +=a;
DrawCar(car, setcolor(15), shpNum);
}
}
then you can do your 'main' function:
int main()
{
int g=DETECT,m; spCar Car; int Shape; int Color;
initgraph(&g,&m,"c:\\turboc3\\bgi");
DrawCar(car, Color, Shape);
move_sp(1, car, Shape);
getch();
closegraph();
return 0;
}
Or something like that...