Home > Back-end >  To solve the
To solve the

Time:09-20

Which bosses, explain the colon I don't see the content constructor in front of the colon specific what meaning of this?  really want to good vexed

CodePudding user response:

Pulic and private: ://the colon here is writing c + + attribute

ExamInfo constructor with behind is for the member variable assignment, this assignment with high efficiency


CodePudding user response:

This list is initialized after the colon, in which general initialize the parent class and object members (members of the class is a class object);
If put it in the body of the function of initialization, is that the assignment operation (erase + copy), for member variables into function devices will be a default initialization, call them the default constructor, if initialization is equivalent to in the function body conducted two initialization, it is cost performance; The specific terms refer to the effective c + + 04 to determine the object being has to be initialized before use
  • Related