0

Possible Duplicate:
Default inheritance access specifier

When class A inherits from class B:

class A: B {...}

Since I didn't specify the type of inheritance, What will the type of inheritance be? Will it be private since it is the default? Or, is there some sort of dependency here? In other words, will the inheritance type depend on the inherited class or the inheriting class?

Thanks.

Community
  • 1
  • 1
Simplicity
  • 47,404
  • 98
  • 256
  • 385
  • Possible duplicate: http://stackoverflow.com/questions/4796789/default-inheritance-access-specifier The accepted answer has a nice explanation of the struct/class and class/struct inheritance cases. – Sergei Tachenov Jan 29 '11 at 16:49

1 Answers1

4

If you don't specify anything, it will be private by default for classes. For structs it will be public by default.

Naveen
  • 74,600
  • 47
  • 176
  • 233