I have the following array:
int distances[10] = {10, 11, 14, 12, 11, 14, 9, 7, 10, 10};
When I ran this array through this for loop:
for (int j = 0; j <= 20; j++) {
std::cout << distances[j] << " ";
}
and printed all of the outputs, this was my output:
10, 11, 14, 12, 11, 14, 9, 7, 10, 10, 4196294, 0, -487465136, 30021, 0, 0, 0, 0, -359687355, 26470, 0
Why are the last 11 elements so varied in size and not in the rest of the array?