Top "Flexible-array-member" questions

Flexible array members is a C feature introduced in C99 whereby one can declare the last element to be an array of unspecified size.

Is using flexible array members in C bad practice?

I recently read that using flexible array members in C was poor software engineering practice. However, that statement was not …

c arrays data-structures flexible-array-member
Are flexible array members valid in C++?

In C99, you can declare a flexible array member of a struct as such: struct blah { int foo[]; }; However, when …

c++ flexible-array-member
How to initialize a structure with flexible array member

I have the following structure typedef struct _person { int age; char sex; char name[]; }person; I have done some basic …

c struct flexible-array-member
What's the need of array with zero elements?

In the Linux kernel code I found the following thing which I can not understand. struct bts_action { u16 type; …

c structure flexible-array-member
Why does static initialization of flexible array member work?

I have written the following basic code for a menu: typedef struct Menu { char* title; unsigned num_submenus; struct Menu *…

c gcc struct initialization flexible-array-member