What does a colon : do after a class definition?

I'm trying to debug some code and I see

1
2
3
4
5
6
7
8
9
10
class SomeClassHere : public AnotherClassHere
{
   public:
       SomeClassMethod();
       virtual ~SomeClassMethod();
   private:
       //stuff in here
   protected:
       // some other stuff here
}


What does the colon do here with another class declared after it like that?
Last edited on
SomeClassHere is derived from class AnotherClassHere. AnotherClassHere is the base class. SomeClassHere has access to the public/protected members of AnotherClassHere

See https://en.cppreference.com/w/cpp/language/derived_class

Ok thats interesting. Thanks.
Topic archived. No new replies allowed.