转自 http://blog.chinaunix.net/uid-20196318-id-28810.html
零长度是指定义数组时,指定其长度为0(如int arr[0];),这样的数组不占用实际的空间,但能通过数组名访问到其指向的地址。如下例所示:
|
运行结果:
p_dev->reserve[0] = 100
p_dev->reserve[24] = 0
sizeof(struct device) = 8
a = 100
内存布局:
num | count | reverse[0] | … | … | … | reverse[24] |
|<-------struct device-------->|