The types of C++ constructors and the case analysis of shallow copy and deep copy
In this article, the editor introduces in detail "the types of C++ constructors, shallow copy and deep copy case analysis" with detailed contents, clear steps and proper handling of details. I hope that this article "C++ constructor types, shallow copy and deep copy case analysis" article can help you solve your doubts.
1. No parameter constructor
1. If no constructor is defined, the system automatically calls the default constructor and does nothing.
two。 If the user defines the constructor with parameters, and if you also want to call the constructor without arguments, you must display the definition
Person () {cout