抽象画的起源:一道C++程序改错题 高手帮忙啊 我怎么改都不对

来源:百度文库 编辑:高考问答 时间:2024/04/29 05:30:55
class one{
private:
int a;
public:
void func(two&);
};
class two{
private:
int b;
friend void one::func(two&);
};
void one::func(two& r)
{
a=r.b;
}

怎么没有main函数啊,那程序要从哪开始啊?

在class one的定义前加上一行声明:
class two;
就行了。