C++ 类 找错误
#include<iostream>using namespace std;
class Main
{
protected:
char *mainfood;
public:
Mian(char *name)
{
mainfood=name;
}
};
class Sub
{
protected:
char *subfood;
public:
Sub(char *name)
{
subfood=name;
}
};
class Menu:public Main,public Sub
{
public:
Menu(char *m,char *s):Main(m),Sub(s)
{ }
void show();
};
void Menu::show()
{
cout<<"主食="<<mainfood<<endl;
cout<<"副食="<<subfood<<endl;
}
int main()
{
Menu m("bread","steak");
m.show();
return 0;
}
请问这个程序哪里错了?
编译里面是划线部分出现错误,谁能解释下?