multiple inherit thing in class

I've read about class & multiple inherit in many shitty pages on the internet but they all failed to give me an example.
Can somebody give me a example: How do i multiple inherit int, float from first class and char, string from other class into the third class ?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
class Numbers {
public:
    int a;
    float b;
};

class Characters {
public:
    char c;
    std::string d;
};

class NumbersAndCharacters: public Numbers, public Characters {
    // whatever is specific to this class goes here
};

That's it. Any instance of NumbersAndCharacters will have all four members.
Last edited on
So that means i just use "," between classes. Thank you very much.
Topic archived. No new replies allowed.