问题描述
我在MSDN上找到了这些链接(LARGE_INTEGER& ULARGE_INTEGER的实现)
[ ]
[]
I found these links on MSDN(Implementation of LARGE_INTEGER & ULARGE_INTEGER)
http://msdn.microsoft.com/en-us/library/windows/desktop/aa383713(v=vs.85).aspx[^]
http://msdn.microsoft.com/en-us/library/windows/desktop/aa383742(v=vs.85).aspx[^]
typedef union _LARGE_INTEGER {
struct {
DWORD LowPart;
LONG HighPart;
};
struct {
DWORD LowPart;
LONG HighPart;
} u;
LONGLONG QuadPart;
} LARGE_INTEGER, *PLARGE_INTEGER;
谁能告诉我对前一个定义的考虑是什么,
和结构名称u是什么意思(意思是未签名?,我是
不确定。)?和为什么/我们应该在哪里使用LARGE_INTEG而不是_int64
提前谢谢
Who can tell me what the consideration for the former definition is,
and what does it mean by the struct name "u" (means "unsigned" ?, I'm
not sure.)? and Why/Where should we use LARGE_INTEGER instead of _int64
Thanks in advance
推荐答案
LARGE_INTEGER li;
li.LowPart = 1;
这是非 - 便携式,以便使其便携式添加指定的结构。现在你可以写:
This is non-portable so to make it portable the named structure u is added. Now you can write:
li.u.LowPart = 1;
在不支持_int64的地方使用它。
Use it where _int64 is not supported.
这篇关于为什么Platform SDK以这种方式定义联合LARGE_INTEGER?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!