DEV Community

Discussion on: Why do integral types get weirdly initialized inside of std::array in C++, and how can I fix it?

Collapse
 
pgradot profile image
Pierre Gradot • Edited

arr is not initialized. So its actual content is not specified.

The behavior you observe is normal: there are random values in the array.

Sometimes, random values look like something you expect (like : all bools are false) but this is pure coincidence.