C language: dynamic list (struct, union, flexible array usage)