Aah! So I was right after all! Except that I thought that {1} would set all to 1, which is false.
I was thinking in a similar way, expecting { 0 } to initialize the first element only good to know. My fault, sorry.
I totally disagree. It stops a host of errors.
It has not slown down program execution to any measurable degree in any application I have written.
Imagine every local variable being initialized twice. I mean here also bigger buffers. Who needs to fill it with zeros, if it will be overwritten with stream's data for a moment. It also obsfucates the code (to me):
Code:
int a = 0;
if (getline())
{
a = 1;
}
else
{
a = 0;
}