#include
using namespace std;
class Car
{
int size;
public:
void getsize(int j) { size = j; }
friend int leisure(int time,const Car& aobj,const Boat& bobj);
};
class Boat
{
int size;
public:
void setsize(int j) { size = j; }
friend int leisure(int time, const Car& aobj, const Boat& bobj);
};
int leisure(int time, const Car& aobj, const Boat& bobj)
{
int t = time*bobj.size;
return t;
}
int main()
{
Car c;
c.getsize(2);
Boat b;
b.setsize(3);
cout << leisure(5, c, b);
}
c:\school learning\vshomework\consoleapplication2\consoleapplication2\源.cpp(8): error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int
1>c:\school learning\vshomework\consoleapplication2\consoleapplication2\源.cpp(8): error C2143: 语法错误: 缺少“,”(在“&”的前面)