关于构造函数的讨论
1. Default constructor:
1.1 Default constuctor means user can call it without parameter. For examples:
Circle::Circle();
Circle::Circle(int n = 0);
1.2 If there is no constuctors, it will provide by compiler automatically. But this constructor do nothing.
The value of the member varables are random and the static members are set to 0.
2. Copy constructor:
2.1 If no define a copy constuctor, the compiler will automatically create one. It will "shallow copy" that means what a member pointer pointed will not be relocate a memory and copy it. So it's a good idea to write the copy constructor by yourself.
Life is a journey, not a destination.
浙公网安备 33010602011771号