c++/作业.obj : error LNK2019: 无法解析的外部符号
#include<iostream>usingnamespacestd;classStu;classPeo{intage;intpassword;intsex;publi...
#include<iostream>
using namespace std;
class Stu;
class Peo{
int age;
int password;
int sex;
public:
char *name;
Peo(int age,int passwod,int sex,char * name);
int p1(){return password;}
};
class Teacher:public Peo{
char* classes;
public :
Teacher(int age,int password,int sex,char* name,char* classes):Peo(age, password, sex,name)
{this->classes=classes;}
void inputscore(Stu & );
};
class Stu: public Peo{
char* major;
float score;
public:
Stu(int age,int password,int sex,char* name ,char* major):Peo(age, password, sex,name)
{
this->major=major;
}
friend void Teacher::inputscore( Stu &);
void checkscore(){
int a;
cout<<"enter password"<<endl;
cin>>a;
if(p1()==a){
cout<<name<<endl<<score<<endl;
}
else
cout<<"password wrong";
}
};
void Teacher ::inputscore(Stu & stu )
{
int a;
cout<<"please enter password";cin>>a;
if(p1()==a)
{cout<<"score=?";
cin>>stu.score;}
else
cout<<"password error";
}
int main()
{Stu s1(20,123456,0,"jack","math");
s1.checkscore();
Teacher t1(25,654123,1,"marry","642");
t1.inputscore(s1);
system("pause");
return 0;
}
-------------------
作业.obj : error LNK2019: 无法解析的外部符号 "public: __thiscall Peo::Peo(int,int,int,char *)" (??0Peo@@QAE@HHHPAD@Z),该符号在函数 "public: __thiscall Teacher::Teacher(int,int,int,char *,char *)" (??0Teacher@@QAE@HHHPAD0@Z) 中被引用
1>c:\users\dingyinghua\documents\visual studio 2010\Projects\22\Debug\22.exe : fatal error LNK1120: 1 个无法解析的外部命令 展开
using namespace std;
class Stu;
class Peo{
int age;
int password;
int sex;
public:
char *name;
Peo(int age,int passwod,int sex,char * name);
int p1(){return password;}
};
class Teacher:public Peo{
char* classes;
public :
Teacher(int age,int password,int sex,char* name,char* classes):Peo(age, password, sex,name)
{this->classes=classes;}
void inputscore(Stu & );
};
class Stu: public Peo{
char* major;
float score;
public:
Stu(int age,int password,int sex,char* name ,char* major):Peo(age, password, sex,name)
{
this->major=major;
}
friend void Teacher::inputscore( Stu &);
void checkscore(){
int a;
cout<<"enter password"<<endl;
cin>>a;
if(p1()==a){
cout<<name<<endl<<score<<endl;
}
else
cout<<"password wrong";
}
};
void Teacher ::inputscore(Stu & stu )
{
int a;
cout<<"please enter password";cin>>a;
if(p1()==a)
{cout<<"score=?";
cin>>stu.score;}
else
cout<<"password error";
}
int main()
{Stu s1(20,123456,0,"jack","math");
s1.checkscore();
Teacher t1(25,654123,1,"marry","642");
t1.inputscore(s1);
system("pause");
return 0;
}
-------------------
作业.obj : error LNK2019: 无法解析的外部符号 "public: __thiscall Peo::Peo(int,int,int,char *)" (??0Peo@@QAE@HHHPAD@Z),该符号在函数 "public: __thiscall Teacher::Teacher(int,int,int,char *,char *)" (??0Teacher@@QAE@HHHPAD0@Z) 中被引用
1>c:\users\dingyinghua\documents\visual studio 2010\Projects\22\Debug\22.exe : fatal error LNK1120: 1 个无法解析的外部命令 展开
浙江启扬智能科技有限公司
2023-06-12 广告
2023-06-12 广告
Linux 嵌入式系统中,USB 启动模式能够烧写 ARM 的 uboot 的原因主要有以下几个方面:1. USB 启动模式相对于传统的 BIOS 启动模式来说,具有更高的兼容性和灵活性,可以支持更多的硬件设备和操作系统。2. USB 启动...
点击进入详情页
本回答由浙江启扬智能科技有限公司提供
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询