了解GUID [英] understanding GUID
问题描述
// GUID表示为< winnt.h>中定义的结构。
typedef struct_GUID {unsigned long Data1;
unsigned short Data2;
unsigned short Data3;
unsigned char Data4 [8];} GUID;
GUID是一个128位的数字?但是看看结构,我有一些
的问题。
Data4是一个长度为8的char数组。意思是Data4是指向
一个数组长于32位(8个字符* 8位= 64),这将使
a
GUID大于128位?
是Data4的一个指针,它们通常不是4位吗?
// The GUID is represented as a structure defined in <winnt.h>.
typedef struct_GUID{ unsigned long Data1;
unsigned short Data2;
unsigned short Data3;
unsigned char Data4[8];} GUID;
GUID is a 128-bit number ? but looking at the structure, i have some
questions.
Data4 is an array of char of length 8. meaning Data4 is a pointer to
an array longer then 32 bits(8 char * 8 bits = 64), which would make
a
GUID bigger then 128 bits?
is Data4 a pointer, are they usually not 4 bits?
推荐答案
Lamefif写道:
Lamefif wrote:
// GUID表示为< winnt.h>中定义的结构。
typedef struct_GUID {unsigned long Data1;
unsigned short Data2;
unsigned short Data3;
unsigned char Data4 [8];} GUID;
GUID是128位数字?
// The GUID is represented as a structure defined in <winnt.h>.
typedef struct_GUID{ unsigned long Data1;
unsigned short Data2;
unsigned short Data3;
unsigned char Data4[8];} GUID;
GUID is a 128-bit number ?
在具有特定大小''short''和'char'的系统上,可能是。
On a system with specific sizes of ''short'' and ''char'', probably.
但是看结构,我有一些
问题。
Data4是一个长度为8的char数组。意思是Data4是一个指向
数组长于32位(8字符* 8位= 64),
but looking at the structure, i have some
questions.
Data4 is an array of char of length 8. meaning Data4 is a pointer to
an array longer then 32 bits(8 char * 8 bits = 64),
呃......怎么可能两者兼而有之?在第一句中你说Data4
是*数组* (强调我的),在第二个你说Data4是
指针。 AFAICS,它是一个数组。
Uh... How could it be both? In the first sentence you said "Data4
is an *array* " (emphasis mine), and in the second you said "Data4 is
a pointer". AFAICS, it''s an array.
这将使
a
GUID大于128位?
which would make
a
GUID bigger then 128 bits?
为什么?假设''long''是32位,''short''是16位,''char''是8
位。假设没有填充。 32 + 16 + 16 + 8 * 8 = 128。
Why? Suppose ''long'' is 32 bits, ''short'' is 16 bits, and ''char'' is 8
bits. Suppose there is no padding. 32 + 16 + 16 + 8*8 =128.
是Data4的一个指针,它们通常不是4位吗?
is Data4 a pointer, are they usually not 4 bits?
Data4不是指针。这是一个数组。
V
-
请在回复时删除资金''A'电子邮件
我没有回复最热门的回复,请不要问
Data4 is NOT a pointer. It''s an array.
V
--
Please remove capital ''A''s when replying by e-mail
I do not respond to top-posted replies, please don''t ask
2007-09-14 15: 35,Lamefif写道:
On 2007-09-14 15:35, Lamefif wrote:
// GUID表示为< winnt.h>中定义的结构。
typedef struct_GUID { unsigned long Data1;
unsigned short Data2;
unsigned short Data3;
unsigned char Data4 [8];} GUID;
GUID是一个128位的数字?但看看结构,我有一些问题。
// The GUID is represented as a structure defined in <winnt.h>.
typedef struct_GUID{ unsigned long Data1;
unsigned short Data2;
unsigned short Data3;
unsigned char Data4[8];} GUID;
GUID is a 128-bit number ? but looking at the structure, i have some
questions.
不,GUID是一个数据结构,它可能占用128位内存,它是b $ b而不是128位数。
-
Erik Wikstr?m
No, GUID is a data-structure which might take 128 bits of memory, it is
not a 128 bit number.
--
Erik Wikstr?m
9月14日下午2:57, Victor Bazarov < v.Abaza ... @ comAcast.netwrote:
On Sep 14, 2:57 pm, "Victor Bazarov" <v.Abaza...@comAcast.netwrote:
Lamefif写道:
Lamefif wrote:
// GUID表示为< winnt.h>中定义的结构。
typedef struct_GUID {unsigned long Data1;
unsigned short Data2;
unsigned short Data3;
unsigned char Data4 [8];} GUID;
// The GUID is represented as a structure defined in <winnt.h>.
typedef struct_GUID{ unsigned long Data1;
unsigned short Data2;
unsigned short Data3;
unsigned char Data4[8];} GUID;
GUID是128位数字?
GUID is a 128-bit number ?
在具有特定大小''short''和'char''的系统上,可能是。
On a system with specific sizes of ''short'' and ''char'', probably.
但是看着结构,我有一些
的问题。
but looking at the structure, i have some
questions.
Data4是一个长度为8的char数组。这意味着Data4是指向
的指针,数组长于32位(8字符* 8位= 64),
Data4 is an array of char of length 8. meaning Data4 is a pointer to
an array longer then 32 bits(8 char * 8 bits = 64),
呃......怎么可能两者兼而有之?在第一句中你说Data4
是*数组* (强调我的),在第二个你说Data4是
指针。 AFAICS,它是一个数组。
Uh... How could it be both? In the first sentence you said "Data4
is an *array* " (emphasis mine), and in the second you said "Data4 is
a pointer". AFAICS, it''s an array.
这将使
a
GUID大于128位?
which would make
a
GUID bigger then 128 bits?
为什么?假设''long''是32位,''short''是16位,''char''是8
位。假设没有填充。 32 + 16 + 16 + 8 * 8 = 128。
Why? Suppose ''long'' is 32 bits, ''short'' is 16 bits, and ''char'' is 8
bits. Suppose there is no padding. 32 + 16 + 16 + 8*8 =128.
是Data4的一个指针,它们通常不是4位吗?
is Data4 a pointer, are they usually not 4 bits?
Data4不是指针。这是一个阵列。
Data4 is NOT a pointer. It''s an array.
谢谢Victor。
Data4是一个变量,它保存第一个字符的地址,No?。
换句话说,我们需要Data4和8个字符的空间吗?
Thanks Victor.
Data4 is a variable that holds the address of the first char, No?.
In other words we would need space for Data4 as well as 8 chars?
这篇关于了解GUID的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!