error LNK2019: 无法解析的外部符号 (新手求助)

qq_28015407 qq_28015407 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
#include "stdafx.h"
#include "iostream"
#include "string"
#include "targetver.h"
using namespace std;

//////////////////////////////////////////////////////////////////////////基类
class person
{
public:
string no;
string name;
person(string i,string j){ no=i;name=j;}
person();
~person();
};
person::~person(){}
/////////////////////////////////////////////////////////////////////////学生派生
class student :private person
{
private:
int Cno;
float score;
public:
student (string n,string na,int cn,float s );
student();
void s_cin(student &s);
void display()
{
cout<<"编号:"<< no<<endl;
cout<<"姓名:"<< name<<endl;
cout<<"班号:"<< Cno<<endl;
cout<<"成绩:"<< score<<endl;
}
~student();
};
/////////////////////////////////////////////////////////////////////////教师派生类
class teacher :private person
{
private:
string wname;
string wage;
public:
teacher (string n,string na,string wn,string wa );
teacher();
void t_cin(teacher &t);
void display()
{
cout<<"编号:"<< no<<endl;
cout<<"姓名:"<< name<<endl;
cout<<"职称:"<< wname<<endl;
cout<<"部门:"<< wage<<endl;
}
~teacher();
};
/////////////////////////////////////////////////////////////////////////
student::student (string n,string na,int cn,float s ):person(n,na)
{
Cno=cn;
score=s;
}

void student::s_cin(student &s)
{
cout<<"输入学生信息:"<<endl;
cin>>s.no>>s.name>>s.Cno>>s.score;
}
student::~student(){}
//////////////////////////////////////////////////////////////////////////
teacher ::teacher(string n,string na,string wn,string wa ):person(n,na)
{
wname=wn;
wage=wa;
}

void teacher::t_cin(teacher &t)
{
cout<<"输入学生信息:"<<endl;
cin>>t.no>>t.name>>t.wname>>t.wage;
}
teacher::~teacher(){}
/////////////////////////////////////////////////////////////////
int _tmain(int argc, _TCHAR* argv[])
{
teacher t;
student s;
s.s_cin(s);
t.t_cin(t);
s.display();
t.display();
return 0;
}
...全文

相关推荐

评论 6
收藏 已收藏
分享
返回顶部
qq_28015407
VC/MFC 16,550 成员 421,606 内容