here's the image of that program
While I tried to print the values of array suppose of length x, its prints correctly but when I tried to print the array with different length rather than predefined length then its giving random values ... how .. ?
here's the image of that program
While I tried to print the values of array suppose of length x, its prints correctly but when I tried to print the array with different length rather than predefined length then its giving random values ... how .. ?
Accessing an array out of bounds* will give undefined behavior. It will compile and run, but the results are not predictable.
0
. An array of nine elements has a maximum index of 8
. You have accessed elements 9
and 10
.