Hey everyone,
Got 2 questions here that i'm hoping will be answered.
Say i have 2 variables
int iValue;
int iValueArray[300];
and later on init. them in the constructor
Banana::Banana():
ival(0),
ivalArray()
{}
What would the ivalArray() indicate? Would it be the same as initializing every element to null/empty? Or does it actually mean something else such as every element is init. to 0?
I've always initialized variables in constructors like
Banana::Banana()
{
iValue = 0;
...
}
is there a difference between initializing after a colon and before the {} and initializing inside the {}. I understand that variables can be init. through 3 different ways so does is this just a matter of syntax preference in terms of initializing variables in constructors?
int someVal = 0;
int someVal (0);
int someVal {0};