Encountered this issue while studying for a test, would appericiate a brief explenation.
If I have a class Object
and another one : class Point : public Object
Now, If I get Object& O1
and Object& O2
, but Object
can be Point
too...
So my main question is how can I check if both of them are Point
Because I need to access a field that Object
doesnt have
Here are the two classes :
Class Object {
public :
some functions
};Class Point : Public Object {
double x;
double y;
public:
same functions different implementation
};
I wanna access x,y but I need to make sure its a Point
first.
Thanks in advance