コード例 #1
0
Big operator+(const Big & lhs, const int & rhs)
{
	std::cout << "*****在operator+里*****" << std::endl;
	Big b(lhs);
	b.setX(lhs.getX() + rhs);
	b.setY(lhs.getY() + rhs);
	std::cout << "*****operator+完成*****" << std::endl;

	return b;
}//operator+(Big, int)
コード例 #2
0
void print(const Big & b)
{
	std::cout << "x=" << b.getX() << std::endl
		<< "y=" << b.getY() << std::endl
		<< "name=" << b.getName() << std::endl << std::endl;
}//print(Big)