<s>
C	B-Language
struct	O
data	O
types	O
may	O
end	O
with	O
a	O
flexible	B-Language
array	I-Language
member	I-Language
with	O
no	O
specified	O
size	O
:	O
</s>
<s>
The	O
sizeof	B-Language
operator	O
on	O
such	O
a	O
struct	O
gives	O
the	O
size	O
of	O
the	O
structure	O
as	O
if	O
the	O
flexible	B-Language
array	I-Language
member	I-Language
were	O
empty	O
.	O
</s>
<s>
This	O
may	O
include	O
padding	O
added	O
to	O
accommodate	O
the	O
flexible	O
member	O
;	O
the	O
compiler	O
is	O
also	O
free	O
to	O
re-use	O
such	O
padding	O
as	O
part	O
of	O
the	O
array	B-Data_Structure
itself	O
.	O
</s>
<s>
It	O
is	O
common	O
to	O
allocate	O
sizeof(struct )	O
+	O
array_len*	O
sizeof(array element )	O
bytes	O
.	O
</s>
<s>
This	O
is	O
not	O
wrong	O
,	O
but	O
it	O
may	O
allocate	O
a	O
few	O
more	O
bytes	O
than	O
necessary	O
:	O
the	O
compiler	O
may	O
be	O
re-purposing	O
some	O
of	O
the	O
padding	O
that	O
is	O
included	O
in	O
sizeof(struct )	O
.	O
</s>
<s>
As	O
the	O
array	B-Data_Structure
may	O
start	O
in	O
the	O
padding	O
before	O
the	O
end	O
of	O
the	O
structure	O
,	O
its	O
content	O
should	O
always	O
be	O
accessed	O
via	O
indexing	O
(	O
arr[i]	O
)	O
or	O
offsetof	O
,	O
not	O
sizeof	B-Language
.	O
</s>
<s>
Flexible	B-Language
array	I-Language
members	I-Language
were	O
officially	O
standardized	O
in	O
C99	B-Language
.	O
</s>
<s>
In	O
practice	O
,	O
compilers	O
(	O
e.g.	O
,	O
GCC	B-Application
,	O
Microsoft	O
's	O
)	O
provided	O
them	O
well	O
before	O
C99	B-Language
was	O
standardized	O
.	O
</s>
<s>
Flexible	B-Language
array	I-Language
members	I-Language
are	O
not	O
officially	O
part	O
of	O
C++	B-Language
,	O
but	O
language	O
extensions	O
are	O
widely	O
available	O
.	O
</s>
