Flexible array members in C - bad?

Posted by Lionel on Stack Overflow See other posts from Stack Overflow or by Lionel
Published on 2008-10-29T14:21:17Z Indexed on 2010/06/01 9:33 UTC
Read the original article Hit count: 156

I recently read that using flexible array members in C was poor software engineering practice. However, that statement was not backed by any argument. Is this an accepted fact?

(Flexible array members are a C feature introduced in C99 whereby one can declare the last element to be an array of unspecified size. For example: )

struct header {
    size_t len;
    unsigned char data[];
};

© Stack Overflow or respective owner

Related posts about c

    Related posts about best-practices