【问题标题】:inheritance c++, getting error when creating a constructor继承c ++,创建构造函数时出错 【发布时间】:2017-03-17 20:22:39 【问题描述】: this is my code and this are the error massages 它必须与默认构造函数做一些事情。我只是不明白错误是什么。 【问题讨论】: 标签: inheritance constructor 【解决方案1】: 您正在为 Son 声明一个构造函数,但没有定义它。在main()中创建son对象时,会调用son的构造函数,必须定义。添加一个空的构造函数将解决这个问题。而不是 son(); 写: son() { } 您的错误消息将消失。 【讨论】: