+151 votes
376 views
what is ctor in c++?
in General by (72 points) | 376 views

Please log in or register to answer this question.

2 Answers

+134 votes
ctor is the short form of the constructor. The same like dtor denotes destructor.
by (111 points)
+155 votes
A constructor is a special type of member function that is called automatically when an object is created. In C++, a constructor has the same name as that of the class and it does not have a return type.
by (1.0k points)