error C2504: 'Cperson' : base class undefined
#include<iostream>usingnamespacestd;classCPerson{public:char*Name;char*Number;char*Se...
#include<iostream>
using namespace std;
class CPerson
{
public:
char *Name;
char *Number;
char *Sex;
int Age;
setmessage(char *Name,char *Number,char *Sex,int Age);
showmessage();
};
class Student : public Cperson
{
private:
char *sname;
char *sno;
char *ssex;
int sage;
public: setmessage(char *sname,char *sno,char *ssex,int sage);
void showmessage()
{
//cout<<*sname<<'+'<<*sno<<'+'<<*ssex<<'+'<<sage<<endl;
cout<<*sname<<*sno<<*ssex<<sage<<endl;
}
};
void main()
{
Student s;
s.setmessage("小","941941941","妖",37);
s.showmessage();
}
报错
--------------------Configuration: test3 - Win32 Debug--------------------
Compiling...
test3.cpp
C:\C++\test3\test3.cpp(18) : error C2504: 'Cperson' : base class undefined
Error executing cl.exe.
test3.exe - 1 error(s), 0 warning(s) 展开
using namespace std;
class CPerson
{
public:
char *Name;
char *Number;
char *Sex;
int Age;
setmessage(char *Name,char *Number,char *Sex,int Age);
showmessage();
};
class Student : public Cperson
{
private:
char *sname;
char *sno;
char *ssex;
int sage;
public: setmessage(char *sname,char *sno,char *ssex,int sage);
void showmessage()
{
//cout<<*sname<<'+'<<*sno<<'+'<<*ssex<<'+'<<sage<<endl;
cout<<*sname<<*sno<<*ssex<<sage<<endl;
}
};
void main()
{
Student s;
s.setmessage("小","941941941","妖",37);
s.showmessage();
}
报错
--------------------Configuration: test3 - Win32 Debug--------------------
Compiling...
test3.cpp
C:\C++\test3\test3.cpp(18) : error C2504: 'Cperson' : base class undefined
Error executing cl.exe.
test3.exe - 1 error(s), 0 warning(s) 展开
威孚半导体技术
2024-08-19 广告
2024-08-19 广告
威孚(苏州)半导体技术有限公司是一家专注生产、研发、销售晶圆传输设备整机模块(EFEM/SORTER)及核心零部件的高科技半导体公司。公司核心团队均拥有多年半导体行业从业经验,其中技术团队成员博士、硕士学历占比80%以上,依托丰富的软件底层...
点击进入详情页
本回答由威孚半导体技术提供
2012-12-11 · 知道合伙人软件行家
关注
展开全部
#include<iostream>
using namespace std;
class CPerson
{
public:
char *Name;
char *Number;
char *Sex;
int Age;
setmessage(char *Name,char *Number,char *Sex,int Age){};
showmessage(){};
};
class Student : public CPerson
{
private:
char *sname;
char *sno;
char *ssex;
int sage;
public:
setmessage(char *sname,char *sno,char *ssex,int sage){};
void showmessage()
{
//cout<<*sname<<'+'<<*sno<<'+'<<*ssex<<'+'<<sage<<endl;
cout<<*sname<<*sno<<*ssex<<sage<<endl;
}
};
void main()
{
Student s;
s.setmessage("小","941941941","妖",37);
s.showmessage();
}
using namespace std;
class CPerson
{
public:
char *Name;
char *Number;
char *Sex;
int Age;
setmessage(char *Name,char *Number,char *Sex,int Age){};
showmessage(){};
};
class Student : public CPerson
{
private:
char *sname;
char *sno;
char *ssex;
int sage;
public:
setmessage(char *sname,char *sno,char *ssex,int sage){};
void showmessage()
{
//cout<<*sname<<'+'<<*sno<<'+'<<*ssex<<'+'<<sage<<endl;
cout<<*sname<<*sno<<*ssex<<sage<<endl;
}
};
void main()
{
Student s;
s.setmessage("小","941941941","妖",37);
s.showmessage();
}
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询