One of the goals of c++ is to create such type of class which is very similar to basic data type like int, char, float etc. It is possible in basic data type like int, char etc we can initialize the data type at the time of creation.
but a member function or friend function cannot initialize the data member at the time of creation of respective objects.
/* Disadvantage of member functions */
Hence C++ introduce a special type of function which is called constructor and it can initialize the data member of respective objects at the time of creation like basic data type int, float etc.