The main purpose of the class constructor in C++ programming is to construct an object of the class . In other word, it is used to initialize all class data members. For example, in below class, constructor Car () is initializing data members with default values.9 Eki 2016