+ 4

How many types of constructors are there in c++?

Give an answer

22nd May 2019, 6:40 AM
Jitendra Mewada
Jitendra Mewada - avatar
5 Antworten
+ 4
In c++ there are three types of Constructer: 1 : Default Constructor. 2: Parametrized Constructor. 3: Copy COnstructor.
23rd May 2019, 11:49 AM
Vijendra Mewada
Vijendra Mewada - avatar
+ 4
It depends on the cpp version previous,11,14,17... Usually the compiler is able to generate default, copy(&) and moove[since c++11] (&&) constructors if you don't declare /delete them Also copy/move assignment operator and destructor is created. You can make as many overloaded constructors as needed.
22nd May 2019, 7:24 AM
AZTECCO
AZTECCO - avatar
+ 3
I don't know the number but I think it is not important care about them. I imagine you kept lots 😂 ,that's why you ask.
22nd May 2019, 6:47 AM
Basel.Al_hajeri?.MBH()
Basel.Al_hajeri?.MBH() - avatar
+ 2
Default, parameterized, Move, Copy... something else?
22nd May 2019, 7:03 AM
HonFu
HonFu - avatar
+ 2
it depends on the cpp version basic constructor are default, parametrised, default parametrised, copy, move constructor. In new version of cpp includes all type of constructor function which written above
23rd May 2019, 1:32 AM
Ameer Wajid Ali
Ameer Wajid Ali - avatar