C struct data types may end with a flexible array member[1] with no specified size: Typically, such structures serve as the header in a larger, variable memory allocation: The sizeof operator on such a struct gives the size of the structure as if the flexible array member were empty.
This is not wrong, but it may allocate a few more bytes than necessary: the compiler may be re-purposing some of the padding that is included in sizeof(struct).
Should this be a concern, macros are available[3] to compute the minimum size while ensuring that the compiler's padding is not disrupted.
As the array may start in the padding before the end of the structure, its content should always be accessed via indexing (arr[i]) or offsetof, not sizeof.
Flexible array members are not officially part of C++, but language extensions[7] are widely available.