A question about classes

Nov 8, 2015 at 4:37pm
I'v looked at a few examples of code involving classes, but there is one thing i do not understand, and can not find information about

Let me give a simple example;

1
2
3
4
5
6
7
8
9
10
11
class A
{
public:
void hello() {cout << "Hello";}
}

class B : public A
{
public:
void hi() {cout << "Hi";}
}


I think I'm missing something but I don't understand what public A is doing behind class B: public A
I mean, what is the use of that? What does it do? Basically, what would that mean and how do I use it? Thanks guys
Last edited on Nov 8, 2015 at 4:41pm
Nov 8, 2015 at 7:17pm
Nov 9, 2015 at 2:02am
Thank you very much, that helps.
Topic archived. No new replies allowed.