0
why do we use Default constructor?
i juat wanna know why do we use default constructora in C++ and what is its work please help me.
2 Respostas
+ 1
if we dont wanna pass an argument for a function call where three arguments are specified in the function definition.
ex. int sum(int i,int j,int k= 10);
0
If you don't define one, the compiler will write one for you, so while it is not required, it is good practice to do so. If there are any default values you need to set, they are set in the constructor.