While debugging my program I noticed that some elements of my 2D-array contain nonzero values.
float Ak[2][2];
Ak[0][0] = 1;
Ak[1][1] = 1;
When I run this code Ak[0][0]
and Ak[1][1]
are 1 as expected but Ak[0][1]
was 1.081 which I actually expected to be 0.
That's probably due to the fact that arrays aren't implicitly initialized. But is this always the case? Do I always have to initialize my arrays when I want specific behavior or are there some cases where the compiler does this automatically? Is it compiler dependent?
And the almost most important question: Where is this behavior specified? (I need a citation for my Thesis)