T
Tapeesh
Does C++ say that a default constructor needs to be generated by the
compiler even if a class has the default constructor defined ? Say for
eg. there is a class
class A
{
int i;
A()
{
i=0;
}
};
class B
{
int i;
void foo()
{
i=0;
}
};
In this case will the compiler generate its own default constructor for
class A like in the case of class B and also create the one defined
in the class ? If yes, then what is the functionality of this compiler
generated constructor.
compiler even if a class has the default constructor defined ? Say for
eg. there is a class
class A
{
int i;
A()
{
i=0;
}
};
class B
{
int i;
void foo()
{
i=0;
}
};
In this case will the compiler generate its own default constructor for
class A like in the case of class B and also create the one defined
in the class ? If yes, then what is the functionality of this compiler
generated constructor.