Why are memory addresses are represented using hexadecimal numbers?

后端 未结 5 1976
既然无缘
既然无缘 2020-12-13 05:21

Whenever I see C programs that refer directly to a specific location on the memory (e.g. a memory barrier) it is done with hexadecimal numbers, also in windows when you get

5条回答
  •  感情败类
    2020-12-13 06:19

    Memory is often manipulated in terms of larger units, such as pages or segments, which tend to have sizes that are powers of 2. So if addresses are expressed in hex, it's much easier to read them as page+offset or similar constructs. Decimal is difficult because of that pesky factor of 5, and binary addresses are too long to be easily readable.

提交回复
热议问题