两个错误,都是关于CStudent类的,error C2572:'CStudent::CStudent' :redefinition of default parameter :parameter 1see declaration of 'CStudent::CStudent'

来源:学生作业帮助网 编辑:六六作业网 时间:2024/11/28 12:20:46
两个错误,都是关于CStudent类的,errorC2572:''CStudent::CStudent'':redefinitionofdefaultparameter:parameter1seedecl

两个错误,都是关于CStudent类的,error C2572:'CStudent::CStudent' :redefinition of default parameter :parameter 1see declaration of 'CStudent::CStudent'
两个错误,都是关于CStudent类的,error C2572:'CStudent::CStudent' :redefinition of default parameter :parameter 1
see declaration of 'CStudent::CStudent'

两个错误,都是关于CStudent类的,error C2572:'CStudent::CStudent' :redefinition of default parameter :parameter 1see declaration of 'CStudent::CStudent'
你是这样写的吧,默认参数就是那个a = 10,声明的时候写上即可,定义的时候去掉
class Student
{
public:
\x09int age;
\x09Student(int a = 10);
};
Student::Student(int a = 10)
{
}
改法:
Student::Student(int a )
{
}