What is the role of constructor in classes in C?

Explanation: A constructor is used in classes to initialize data members of class in order to avoid errors/segmentation faults .

Sizin İçin Seçtik  Is a constructor necessary?

Leave a Reply

Your email address will not be published. Required fields are marked *