继承与派生问题求助
#include<iostream.h>class point
{
public:
void initp(float xx=0,float yy=0)
{x=xx;y=yy;}
private:
float x,y;
};
class water:public point
{
public:
void initr(float a=0,float b=0,float c=0)
{initp(a,b);m=c;}
private:
float m;
};
int main()
{
water f;
f.initr(3,4,5);
return 0;
}
55.obj : error LNK2005: _main already defined in 11.obj
Debug/11.exe : fatal error LNK1169: one or more multiply defined symbols found
Error executing link.exe.
按照书上一模一样的,为什么就是调试出错,请高手帮忙。