Array with size 0

后端 未结 4 1112
-上瘾入骨i
-上瘾入骨i 2020-11-27 03:59

Today I incidentally defined a two dimensional array with the size of one dimension being 0, however my compiler did not complain. I found the following which states that th

4条回答
  •  清酒与你
    2020-11-27 04:31

    Your link explains everything. They are used as last field in a struct when the length of struct is not known at compile time. If you try using them on stack or in a middle of other declarations you will end up overwriting next elements.

提交回复
热议问题