Contents|Index|Previous|Next

Arrays of Length Zero

Zero-length arrays are allowed in GNU C. They are very useful as the last element of a structure which is really a header for a variable-length object.

In standard C, you would have to give contents a length of 1, which means either you waste space or complicate the argument to malloc.