Why are memory addresses are represented using hexadecimal numbers?

后端 未结 5 1979
既然无缘
既然无缘 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:10

    Convention and convenience: hex shows more clearly what relationship various pointers have to address segmenting. (For example, shared libraries are usually loaded on even hex boundaries, and the data segment likewise is on an even boundary.) DEC minicomputer convention actually preferred octal, but IBM's hex preference won out in practice.

    (As for why this matters: what's easier to remember, 0xb73eb000 or 3074338816? It's the address of one of the shared objects in my current shell on jinx.)

提交回复
热议问题