I was doing one programming problem, there I initialized the bool array like following:-
bool hash[n] = {0};
I submitted the code and I got the wrong answer. I tried to figure out what is the problem. Then I changed the above statement to following:-
bool hash[n];
fill(hash, hash + n, 0);
This gave correct answer. I didn't understand why the bool array initialization is not working.
After that just out of curiosity, I tried following:-
bool hash[n] = {0};
fill(hash, hash + n, 0);
I submitted the code and I got wrong answer. This really blew my mind. Any inputs?