I don’t get the point why my member is not initialised. I have something like this:
class A
{
public:
A() {member = 0;}
int getMember() {return member;}
protected:
int member;
}
and
class B : public A
{
public:
B() : A() {member = 10;}
}
When I try to get the value of member from B it is always 0.
What do I miss here?
Thanks!
EDIT: Ctor is public now.
I tried two things and they both give the expected result:
This returns
You can check the code at http://ideone.com/FArIAC