Possible Duplicate:
Finding the type of an object in C++
Hello,
I am sorry if it's a duplicate but I was not able to find answer to my question here.
Let's assume we have following class structure in c++:
class CPolygon {
protected:
int width, height;
public:
void set_values (int a, int b)
{ width=a; height=b; }
};
class CRectangle: public CPolygon {
public:
int area ()
{ return (width * height); }
};
Now I have got a pointer to CPolygon object. How do I check if it's actually a pointer to the object of class CRectangle?