Saturday, July 7, 2012

Constructing variable length structs in C

A trick to using structs that have a variable sized member is to use an overloaded operator new to allocate space for the struct.

struct string