You copied the Doc URL to your clipboard.

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.


typedef struct
    int len;
    char p[]; // incomplete array type, for use in a malloc'd data structure
} str;

See also