It's not good enough to simply write code that works. That code must be easily maintained, enhanced and debugged when problems happen. One of the reasons why object-oriented programming is so popular ...
In C++, a constructor is a special function that must be invoked when an object is created. Its objective is to initialize a new object to a valid state before any processing occurs using the object.
一些您可能无法访问的结果已被隐去。
显示无法访问的结果