-1

Can anyone tell me how to restrict inheritance in c++ with example? is their any possibility of doing it by using private mode of inheritance?

Indrajit
  • 1
  • 2

1 Answers1

3

You can declare a class to be final and therefore no other classes can derive from it. You can also specify that individual functions are final.

Cory Kramer
  • 114,268
  • 16
  • 167
  • 218