Sorry about my bad explanation, I meant that it will never be used by itself and that it can only be used from a derived class
this is still wrong mate. Just because a class has a pure virtual function, it doesnt mean that it can't call that function itself!
Here is an example of a class that calls one of it's own pure virtual functions.. and it works fine (BTW, i havent' compiled this... but i know it works)
Code:
class Shape
{
public:
void ShowArea(void);
virtual int Area(void) = 0;
};
class Square : public Shape
{
public:
virtual int Area(void);
};
void Shape::ShowArea(void)
{
cout << "My area is " << Area() << endl;
}
int Square::Area(void)
{
return(side * side);
}
i hope this clears it up.
U.