I am following the book \"C Primer Plus\" and encounter a problem to understand the regions of memory. In the book, it states:
Typically, a p
I want to try and explain this in a more simple way.
0x... is a hexadecimal string that represents a string of binary bits. You can think of it as representing a number, but shorthand because you don't need to know the number, just it's relative value to other similarly coded numbers. So this means that the "address value" is actually just a number.
Why use numbers to represent memory locations? Because for all intents and purposes, memory is just a really large byte array, who's values can be read by index. C logically (not physically) divides this memory array into different sections for efficient storage. So the closer 2 address locations are in memory, the closer they are together in that byte array representation.
The address range available to any application is determined at runtime, and is not actually any part of specific memory spaces. So in all fairness, there is no why to know for sure that certain items are in a certain memory region. Just that it is highly statistically implausible for 2 objects close together in memory to be in different regions.