How do I call the base class constructor?

Viewed 164479

Lately, I have done much programming in Java. There, you call the class you inherited from with super(). (You all probably know that.)

Now I have a class in C++, which has a default constructor which takes some arguments. Example:

class BaseClass {
public:
    BaseClass(char *name); .... 

If I inherit the class, it gives me the warning that there is no appropriate default constructor available. So, is there something like super() in C++, or do I have to define a function where I initialize all variables?

6 Answers
Related