【c++】
class City
{
Point location;
char name[MAX_CITY_NAME];
public:
double distance(const City & other) const
{
return location.distance(other.location);
}
Point get_location(void) const
{
return location;
}
// other methods and constructors here
};
class Point
{
double x,y;
public:
double distance( const Point & p){ //code }
// other methods and constructors here
};