In C ++, there is no difference between structures and classes. All of them are simply called class types.
Members of class types do not have default values ββin the general case. For a class member to get a deterministic value, it must be initialized, which can be done
- The default constructor of the element itself
- List of wrapper class constructor initializers
- The explicit initializer for the object of the incoming class (which includes initialization initialization initialization and initialization).
In addition, all objects with a static storage duration are initialized to zeros when the program starts.
In addition to the above cases, class members again have no default values ββand will initially contain unpredictable garbage values.
AnT Apr 10 2018-10-10T00: 00Z
source share