Flexible array member (c99) inside a structure

后端 未结 2 1200
北海茫月
北海茫月 2021-01-25 15:26

I\'ve being using this code a while now, and it works fine, but it gave me some headache to implement it. It uses Flexible Array Member (FAM) aka Struct Hack. Now that C99 has t

2条回答
  •  无人及你
    2021-01-25 15:53

    The C name for that construction is "flexible array member" (it might help your searches), or "struct hack" before C99.

    Look at 6.7.2.1 in the Standard; there is example usage in the text.


    You may also be interested in "Variable Length Arrays". See 6.7.5.2 in The Standard.

提交回复
热议问题