[求助]这个书上的题目为什么错了啊
#include "iostream.h"
class a
class b{int b;
public:
b(int m)
{b=m;
}
void rec(a &r);
};
class a{int b;
public:
void sr()
{cout<<"the value is:"<<b<<endl;
}
friend void b::rec(a &r)
{r.b=b;
}
};
void main()
{b r1(34);
a r2;
r1.rec(r2);
r2.sr();
}