主要目的:
本代码主要目的在于探究在组合类中创建以及初始化对象时,各个类的构造函数的调用情况。
/*------------------------------------------------------------------------
功能:探究组合类中构造函数的相关问题
运行结果:
Calling the argument constructor of point... // 对应92行创建点对象p1, p2
Calling the argument constructor of point...
Calling the copy constructor of Point... // 对应93行创建线段对象l1
Calling the copy constructor of Point...
Calling the copy constructor of Point...
Calling the copy constructor of Point...
Calling the argument constructor of Line...
Calling the default constructor of point... // 对应94行创建线段对象l2
Calling the default constructor of point...
Calling the copy constructor of Line...
The length of l1 is: 1.41421 // 对应95行
The length of l2 is: 1.41421 // 对应96行
--------------------------------------------------------------------------
Author: Zhang Kaizhou
Date: 2019-3-31 14:34:09
-------------------------------------------------------------------------*/
#include <iostream>
#include <cmath>
using na