As I'm getting to know about inheritance in C++, one thing that has stuck in my mind is using public keyword before class_name as in-
class Derived: public Base {}
What I wonder is that why do we need to make a class public that's already outside the main function?
Isn't something global?I understand making class members public, but why to make the whole class public?
What's there behind the scene that I need to know?