error LNK2019: 无法解析的外部符号 (新手求助)
#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;
}
...全文
相关推荐
error LNK2019: 无法解析的外部符号 问题的解决办法
error LNK2019: 无法解析的外部符号 问题的解决办法,需要的朋友可以参考一下
如何解决 error LNK2019 无法解析的外部符号,该符号在函数 中被引用
如何解决 error LNK2019 无法解析的外部符号,该符号在函数 中被引用
解决error LNK2001 无法解析的外部符号 int __cdecl sprintf(
解决error LNK2001 无法解析的外部符号 int __cdecl sprintf(
error LNK1120和error lnk2001
对于编程人员在编译程序的时候经常会遇到error LNK1120和error lnk2001这问题,跟大家分享一下自己找到的资料,以及自己遇到的问题,希望对大家有帮助。
vc报错解决办法 error LNK2019无法解析的外部符号,该符号在函数 中被引用
vc报错 error LNK2019无法解析的外部符号,该符号在函数 中被引用 的解决办法 解决办法不难,不想收这么高的费用,但是CSDN最低收费就是9.9元,我也没办法。而且我连1/3都分不到


