Im having a little problem with classes.
In code:
class A
{
public:
int num;
sayNum() { cout<<num;}
};
class B : public A
{
public:
sayNum() { cout<<"my num is: "<<num;}
};
/*somewhere else...*/
A foo[10];
B something;
something.num=10;
foo[0]=something;
foo[0].sayNum();
/*...*/
When I call foo[0].sayNum(); it prints "10", and I would like it to print "my num is: 10". I can't change the type of the array. Note that it is just an example code, if I paste mine here it would be hard to understand :D)