Is there any difference in initializing a variable in any of these forms of constructors? And how do I put a constructor as default ( default ) in a class that has more than one constructor?
Builder 1:
class Teste
{
private:
int valor1, valor2;
float valor3;
public:
Teste(void) : valor1(0), valor2(0), valor3(0.f) {}
};
Builder 2:
class Teste
{
private:
int valor1, valor2;
float valor3;
public:
Teste(void)
{
valor1 = 0;
valor2 = 0;
valor3 = 0.f;
}
};
I am currently preferring to use constructor method 1 because I find it cleaner, changes into something?