Considering the following class definition:
class Foo {
private:
int a;
int b;
public:
Foo() :
a()
{}
};
If I recall correctly, a()
will call the default constructor of int
and initialize it to 0. If I leave out the constructor, it's undefined what happens to the member variables. But what about b
in this example? For my version of gcc it seems to be set to 0 as well, but is that defined behaviour?
Thanks for your answers.