Using the Parent constructor to initialize a child class

岁酱吖の 提交于 2019-12-07 15:14:25

StartButton only has one constructor:

StartButton(): Button(pos, text){};

which attempts to initialize the base Button with garbage. You need a proper constructor for StartButton:

StartButton(ofPoint _pos, string _text) : Button(_pos, _text) {}

or if you can afford C++11, inheriting the constructors from Button:

using Button::Button;
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!