Erm, I came across a weird problem with boolean arrays, if you declare bool array globally, its whole content is automatically set to false (0s), however when u declare that array inside any function then its values are screwed up, i mean some of them are 0s, some are completely random, why is that ?
Objects with static storage duration, such as globals, are always zero-initialized by default. When you declare the array inside a function it will not be initialized by default so that's why you get garbage values. If you want to zero initialize the array you can just initialize it with an empty pair of curly brackets.