String is where buffer overflow always occur.
GLIB supports doing this much more easily:
/* portable asprintf() */
char *str = g_strdup_printf("string%s%d", str_variable, int_variable);
Or if you wanted a modifyable buffer:
GString *str = g_string_new(NULL);
g_string_sprintfa(str, "%d", int_variable); /* no g_string_append_int() */
extern – Variables described by extern statements will not have any space allocated for them, as they should be properly defined elsewhere.
static – The static data type modifier is used to create permanent storage for variables. Static variables keep their value between function calls. When used in a class, all instantiations of that class share one copy of the variable.
const – The const keyword can be used to tell the compiler that a certain variable should not be modified once it has been initialized.