在这里对我来说非常简单的任务,我不确定为什么这会给我带来问题,我只是让两个模型类尝试在它们的方法中没有任何逻辑的情况下使用已经给我的标题和声明进行编译。老实说,这只是一个剪切和粘贴的工作,但我仍然遇到了这个金块般的爱情——
cbutton.cpp:11:44: error: default argument given for parameter 4 of ‘cio::CButton::CButton(const char*, int, int, bool, const char*)’ [-fpermissive]
cbutton.h:7:5: error: after previous specification in ‘cio::CButton::CButton(const char*, int, int, bool, const char*)’ [-fpermissive]
cbutton.cpp:11:44: error: default argument given for parameter 5 of ‘cio::CButton::CButton(const char*, int, int, bool, const char*)’ [-fpermissive]
cbutton.h:7:5: error: after previous specification in ‘cio::CButton::CButton(const char*, int, int, bool, const char*)’ [-fpermissive]
cbutton.cpp:19:41: error: default argument given for parameter 1 of ‘void cio::CButton::draw(int)’ [-fpermissive]
cbutton.h:11:10: error: after previous specification in ‘virtual void cio::CButton::draw(int)’ [-fpermissive]
cbutton.cpp:53:29: error: ‘virtual’ outside class declaration
这是我正在使用的文件。谢谢大家,一如既往!
#include "cfield.h"
namespace cio{
class CButton: public CField{
public:
CButton(const char *Str, int Row, int Col,
bool Bordered = true,
const char* Border=C_BORDER_CHARS);
virtual ~CButton();
void draw(int rn=C_FULL_FRAME);
int edit();
bool editable()const;
void set(const void* str);
};
}
#include "cbutton.h"
namespace cio {
CButton::CButton(const char *Str, int Row, int Col,
bool Bordered = true,
const char* Border=C_BORDER_CHARS){
}
void CButton::draw(int rn=C_FULL_FRAME){
}
int CButton::edit(){
return 0;
}
bool CButton::editable()const {
return false;
}
void CButton::set(const void* str){
}
virtual CButton::~CButton(){
}
}