EdjeMessageStringSet* m = (EdjeMessageStringSet*) safemalloc( sizeof(Edje_Message_String_Set) + (count-1)*sizeof(char *) ); if (m == NULL) croak("Failed to allocate memory in _new function\n"); #### typedef struct { int count; char *str[1]; // may be fine with [] or even just char* str (no subscript at all) } Edje_Message_String_Set; #### typedef struct { int count; char** string_array; } Edje_Message_String_Set;