Why do we need constructor in C?

The main use of constructors is to initialize the private fields of the class while creating an instance for the class . When you have not created a constructor in the class, the compiler will automatically create a default constructor of the class.

Sizin İçin Seçtik  Coin Fibonacci nasıl yapılır?

Leave a Reply

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