what does this mean?

S

sanerqi

class A{
/*...*/
};
class B:A{
/*....*/
};


class B is derived from A? there is not "public","private"... before
A,why?
 
I

Ian Collins

sanerqi said:
class A{
/*...*/
};
class B:A{
/*....*/
};


class B is derived from A? there is not "public","private"... before
A,why?

What does your C++ book tell you about default inheritance?
 
J

Juha Nieminen

sanerqi said:
class A{
/*...*/
};
class B:A{
/*....*/
};


class B is derived from A? there is not "public","private"... before
A,why?

Because it's valid to omit it. If nothing is specified, private
inheritance is assumed.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,169
Messages
2,570,920
Members
47,464
Latest member
Bobbylenly

Latest Threads

Top