8.9 Flexible array members

The last member of a struct can have an incomplete array type.

The last member must not be the only member of the struct, otherwise the struct is zero in size.

Examples

typedef struct
{
    int len;
    char p[]; // incomplete array type, for use in a malloc’d data structure
} str;
Related concepts
4.62 New language features of C99
Non-ConfidentialPDF file icon PDF versionARM DUI0375E
Copyright © 2007, 2008, 2011, 2012, 2014 ARM. All rights reserved.