Quiz- Win32内存表示与数值大小

问题

在VS2010的memory窗口中查看地址为0x00635878内存, 如图.

image

 

如果我一直该地址的内存存储的值是一个指针, 那么该指针的值是多少?

A. 40b4ca74

B. 47ac4b04

C. 74cab440

D. 044bac47

 

答案

C. 74cab440

 

这里涉及到了一个little endian的概念.

These two phrases “Big Endian” and “Little Endian” are derived from "Big End In" and "Little End In." They refer to the way in which memory is stored.

On an Intel computer, the little end is stored first. This means a Hex word like 0x1234 is stored in memory as (0x34 0x12). The little end, or lower end, is stored first. The same is true for a four-byte value; for example, 0x12345678 would be stored as (0x78 0x56 0x34 0x12).

"Big End In" does this in the reverse fashion, so 0x1234 would be stored as (0x12 0x34) in memory. This is the method used by Motorola computers and can also be used on RISC-based computers. The RISC-based MIPS computers and the DEC Alpha computers are configurable for Big Endian or Little Endian. Windows NT works only in the Little Endian mode on both computers.

http://support.microsoft.com/kb/102025

posted on 2012-08-02 11:44  中道学友  阅读(280)  评论(0编辑  收藏  举报

导航

技术追求准确,态度积极向上