开发者

How to get back the two components of a long integer

 DWORDLONG index = ((((DWORDLONG) i.nFileIndexHigh) << 32) | i.nFileIndexLow);

Given index, I want to find out what the components of i.file开发者_如何转开发indexhigh and i.fileindexlow are. Is it possible? A general idea would be helpful.


Yes, its possible, you just need to do the inverse operation of what you posted: instead of << and |, >> and &,

nFileIndexLow = index & 0x00000000FFFFFFFF;
nFileIndexHigh = index >> 32;

Consider researching on bitwise operations, or at least put your calculator in hexadecimal/binary mode and play with masks and shifts.


i.nFileIndexHigh == index >> 32; i.nFileIndexLow == index & 0x00000000FFFFFFFF;

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜