ProAnswers.org

what is a constructor in C++?

A constructor is a special type of function that gets called every time you initialize a class. constructor is used to declare variables before the object of the class is created.