#include<iostream>
class Car;
class Boat
{
private:
int weight ;
public:
Boat(int);
void getTotalWeight( Car &);
};
class Car
{
private:
int weight ;
public:
Car(int);
friend void Boat :: getTotalWeight( Car &);
};
Boat::Boat(int w)
{
weight=w;
}
Car::Car(int w)
{
weight=w;
}
void Boat :: getTotalWeight( Car &t)
{
int sum=weight+t.weight;
std::cout<<sum;
}
int main ()
{
Boat b(2);
Car c(3);
b.getTotalWeight(c);
}