class Rectangle:public Shape
{
int height;
int width;
public:
void CreateRect(Rectangle*);
int GetHeight(Rectangle*);
int GetWidth (Rectangle*);
float Area();
int GetDiagonal();
void printrect(Rectangle*);
};
and:
1 2 3 4 5 6 7 8 9 10 11
class Circle:public Shape
{
int radius;
public:
void CreateCirc(Circle*);
int GetRadius(Circle*);
float Area() ;
int GetDiameter();
friendclass Shape;
void printcircle(Circle*);
};
and a base class:
1 2 3 4 5 6 7 8 9 10 11 12 13 14
[code]class Shape
{
protected:
int location;
char * name;
int x;
int y;
public:
void ChangeLocation();
int GetLocation();
virtualfloat Area()=0;
friendclass Circle;
friendclass rectangle;
};
i tried to initiate a string of pointers to the classe like this:
[/code]
1 2 3 4 5
int main()
{
Shape *picture[20];
picture[0]=new Circle;
}
but its not working and im unable to access the Circle's methods. can someone please explain to me how its done?