PREV INDEX NEXT

Author: Unknown
Subject: Initializing an array
Date: Tuesday, 11 Feb 2020, 20:59:29

In my code , I am declaring a new array without assigning any of its values. The next line declares another variable, totally unrelated to the array. In gdb, when I go through my code line-by-line, displaying the array at every line, at the line where I declare the array gdb says the value of my array = "error cannot access memory at address 0x0." I hit n once, and at the next line the value of my array has been initialized to all zeroes except the first element, which is 2. How is it possible for an array to be initialized to a nonzero value without my having assigned it any value?
PREV INDEX NEXT