- Jul 23, 2006
- 3,934
- 0
- 76
Most of my programming experience insofar has been C# and Java, I've been working with C++ lately and my question is about the use of the public modifier when using inheritance.
An Example:
class BaseClass
{
// Blah Blah Blah
};
class DerivedClass : public BaseClass
{
// More Blah
}
What is the meaning of the "public" following the colon? I've been looking around on the internet and most things just say to use it without commenting on its meaning.
Also, would:
class DerivedClass : private BaseClass {};
or
class DerivedClass : BaseClass{};
ever desirable?
An Example:
class BaseClass
{
// Blah Blah Blah
};
class DerivedClass : public BaseClass
{
// More Blah
}
What is the meaning of the "public" following the colon? I've been looking around on the internet and most things just say to use it without commenting on its meaning.
Also, would:
class DerivedClass : private BaseClass {};
or
class DerivedClass : BaseClass{};
ever desirable?
