0

What is constructors?

4th Sep 2016, 8:21 AM
Sliicezr
Sliicezr - avatar
1 Antwort
0
Constructors are special member functions of classes which are run for each object created (at the moment of creation). They look like simple member functions but have np return type and their name is the class's name. They may contain initialozations or pretty much anything you want to. A default one is always defined if you don't define at least one (if you do, the compiler will not generate a default). You can have multiple constructors (overloading).
6th Sep 2016, 7:55 PM
Norbivar
Norbivar - avatar