#include<iostream>
#include<cstring>
using namespace std;
class Mammal
{
private:
char Name[10];
float Age,Weight;
public:
Mammal(char *name,float age,float weight )
{
strcpy(Name, name);
Age=age;
Weight=weight;
}
~Mammal()
{cout<<"destructing Mammal"<<endl;
}
};
class Dog:public Mammal
{
private:
char Food[10];
public:
Dog::Dog(char *name,float age,float weight,char *food):Mammal(char *name,float age,float weight)
{
strcpy(Food,food);
}
void print()
{
return Mammal::print();
cout<<"food is "<<Food<<endl;
~Dog()
{cout<<"destructing Dog"<<endl;
}
};
void main()
{
Dog littledog("dog",3,12,"bone");
}
C:\Program Files\Microsoft Visual Studio\MyProjects\aa\aa.cpp(41) : fatal error C1004: unexpected end of file found
这个错误怎么解决啊??