When you declare variable x of type int in C or C++, I understand it'll take 4 bytes of memory. Therefore 4 memory addresses are allocated for this variable. My question is can I see all four memory address allocated this variable? I know this ins't a typical question, but I am curious. Or is it 100% always just the memory address &x and the 3 next bits? So if it was memory address 1000, the next will be 1001, 1002, and 1003? Does it ever deviate from this?
Also say I set x = 5;
Does this mean in this memory location 1000 to 1002, it'll be filled with zeroes and in 1003, there's a 101 (binary representation of 5) in the rightmost position?
Thank you