#include
#include
using namespace std;
class student //声明基类
{
public:
student(int n,char na,char s)
{
num=n;name=na;sex=s;
}
void display()
{cout<<"num="<
char num;
char name;
char sex;
};
class student1:public student
{
public:
student1(char n,char na,char s,char a,char addr):
student(n,na,s){
age=a;address=addr;
}
void display1()
{display();
cout<<"age="<
char age;
char address;
};
int main()
{
student1 stud1("c","a","m","c","a");
stud1.display1();
return 0;
}
--------------------Configuration: 5-1-2 - Win32 Debug--------------------
Compiling...
5-1-2.cpp
e:\vc++6.0编程\homework\5-1-2.cpp(43) : error C2664: '__thiscall student1::student1(char,char,char,char,char)' : cannot convert parameter 1 from 'char [2]' to 'char'
This conversion requires a reinterpret_cast, a C-style cast or function-style cast
Error executing cl.exe.
5-1-2.obj - 1 error(s), 0 warning(s)