当派生类和基类都有参数化构造函数时,如何初始化派生类的对象?

V K*_*V K 1 c++ constructor

我在初始化对象时遇到问题.以下是一段代码,

#include <iostream>
#include <conio.h>
using namespace std;

class Base
{
public:
Base(int a)
{
    m_a = a;
}
private:
int m_a;

};

class Derived:public Base
{
public:
Derived(char a)
{
    m_a = a;
}
private:
char m_a;

};


void main()
{

_getch();

}
Run Code Online (Sandbox Code Playgroud)

编译上面的代码会出现以下错误,错误C2512:'Base':没有合适的默认构造函数可用

我知道由于派生类和基类都只有参数化构造函数,我需要在派生类构造函数中初始化基类对象.但我不知道该怎么做.谁能告诉我上面的代码有什么问题?

Hei*_*bug 6

    public:
    Derived(char a):Base(/*int Parameter*/),m_a(a)
    {

    }
Run Code Online (Sandbox Code Playgroud)