调试程序出现问题,请指点迷津
#include <iostream.h>class X
{
int m_ivar;
public:
X(int i)
{m_ivar=i;
cout<<"m_ivar的值是:"<<endl;}
X(const X &Other)
{m_ivar=Other.m_ivar;
cout<<"m_ivar的值是:"<<endl;}
X func(X x)
{
return x;
}
void print()
{cout<<"m_ivar="<<m_ivar<<endl;}
};
void main()
{
X x1(1);
x1.print();
X x2(x1);
x2.print();
X x3=x2;
x3.print();
X x4(2);
X x5=func(x4);
}
调试时出现error C2065: 'func' : undeclared identifier
我不知道怎么改