Memory

Last modified Monday, 13-Jan-2025 14:53:13 UTC.
C is so intertwined with memory so that you have to understand "what goes where". C has three different pools of memory: To pinpoint each memory location in a program’s memory, we assign each byte of memory an "address" that go from 0 to the largest possible address, depending on the machine. As the figure below shows, the heap segments have low address numbers, while the stack memory has higher addresses.

By convention, we express these addresses in base 16 numbers. For instance, the smallest possible address is 0x00000000 (where the 0x means base 16), and the largest possible address could be 0xFFFFFFFF.