I have placed an integer in a matrix and have asked it to read out the values in each part of the matrix. The number is correct where I've placed the integer but the other section give me very long numbers where there ought to be 0's. Please could someone tell me why this occurs? Thank you
Every element except the one at [0][1] is uninitialized.
(and you'll get lots of comments about using the gcc variable length array extension to the language; it's
not a big deal, and it won't break your program, just know that your code is not portable to other compilers
as written. To fix, change int x and int y to const int x and const int y. Then you'll have to change the
variable name in your for loops).