By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,421 Members | 1,127 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,421 IT Pros & Developers. It's quick & easy.

Can a class call its indirect base's member function?

P: n/a
In the following code segment, is the statement
me.set();
correct?

class grandfather {
...
void set();
};

class father : public grandfather {
...
};

class son : public father {
...
};

son me;
me.set();
Jul 19 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a

"Yu Lianqing" <yu**********@netscape.net> wrote in message
news:66**************************@posting.google.c om...
In the following code segment, is the statement
me.set();
correct?

class grandfather {
...
void set();
};

class father : public grandfather {
...
};

class son : public father {
...
};

son me;
me.set();


Assuming set is public, then yes.

john
Jul 19 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.