意外结尾是什么意思啊!!!
编译时说什么意外结尾。。。。帮忙看下..........错误报告在下面。。#include <iostream.h>
class Animal
{
public:
void eat()
{
cout<<"animal eat"<<endl;
}
void sleep()
{
cout<<"animal sleep"<<endl;
}
virtual void breathe()
{
cout<<"animal breathe"<<endl;
}
Animal()
{
}
Animal(int heigeht,int weight)
{
cout<<"animal constuct"<<endl;
}
};
class Fish:public Animal
{
public:
Fish():Animal(300,400)
{
cout<<"fish contruct"<<endl;
}
void breathe()
{
cout<<"fish bublle"<<endl;
};
/*void fn(Animal* pAn)
{
pAn->breathe();
}*/
void main()
{
Animal an;
an.eat();
// Animal* pAn;
Fish fh;
// pAn=&fh;
// fn(pAn);
fh.breathe();
}
错误报告:
--------------------Configuration: di2bian - Win32 Debug--------------------
Compiling...
woyumen a.cpp
E:\C++\MSDev98\MyProjects\di2bian\woyumen a.cpp(50) : fatal error C1004: unexpected end of file found
执行 cl.exe 时出错.
di2bian.exe - 1 error(s), 0 warning(s)