Do I have to initialize simple class member variables?
- by Frank
Quick beginner's question:
Do I have to initialize simple class member variables, or are they guaranteed to get assigned their default values in any case?
Example:
class Foo {
int i;
// is i==0 or do I need the following line for that?
Foo() : i(0) {}
};
Thanks!