Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - C++ topic, this road is entitled what B to choose?
C++ topic, this road is entitled what B to choose?
A: The default constructor of a general class (without parameters) will be automatically generated, but if you define a constructor with parameters, the default constructor will not be automatically generated. You need to define a default constructor yourself. Option A defines a class object with no parameters, so it calls the default constructor, but the class does not define the default constructor, so it is wrong.

B: It is a pointer that defines an object, and the object is not created, so the constructor of the class is not called. There are no mistakes.

C: Data is in the private part of the class, that is, data can only be accessed through class methods, not directly through class objects. all wet

D:MyClass is a class name, not a class object. Therefore, if it wants to represent the method of a class, it needs to parse the symbol.

my class::show(); //Class name call

or

my class x(3); //Class object call

x . show();