c++ - 在 C++ 中的继承类中创建构造函数后出错
问题描述
当我在 Rechteck 类中创建构造函数时遇到问题,错误见代码注释行*(没有用于调用'Form::Form()'| 的匹配函数)Form 类工作得很好。我正在使用代码::块。谢谢
class Form
{
protected:
std::string name;
sf::Vector2f bezugsp;
sf::Color farbe;
sf::VertexArray punkte;
public:
Form(const std::string &n, const sf::Vector2f &bp=sf::Vector2f(0.,0.),
const sf::Color fa=sf::Color::Black){}
~Form();
std::string get_name() const{}
sf::VertexArray get_punkte() const{}
sf::Vector2f get_bezugsp() const{}
void set_bezugsp(const sf::Vector2f bp){}
void set_farbe(const sf::Color fa){}
void gen_array(){}
};
class Rechteck : public Form
{
public:
float hoehe=0;
float breite=0;
Rechteck(){ //AT THIS LINE ERROR************
}
virtual ~Rechteck(){}
void dew(){}
protected:
private:
};
解决方案
推荐阅读
- google-cloud-firestore - 如何从 Firestore 规则中的请求路径获取数据
- java - 我可以在 servlet 页面中插入引导程序吗?如果可能,那怎么办?
- java - 需要 SSLAdapterFactory 和 BaseWLSSLAdapter 的正确 jar
- go - 为什么映射中的键和值共享相同的内存地址?
- python - 是否可以“动态”修改实例属性?可能通过将字符串与变量名匹配?
- javascript - 如果嵌入没有 author.name 它会给我一个错误
- c# - 如何使用 .NET SDK for Azure Service Bus 从服务总线主题及其订阅中读取死信计数?
- android - 导入模块后找不到android自定义库中的样式父
- javascript - 尝试创建一个使输入加倍的按钮
- discord - discord bot可以加入频道但不能播放音乐