#include #include #include int main(void) { gint32 slow = g_random_int_range(0, 4); /* See https://stackoverflow.com/a/16299867 for format explanation. */ gchar *str = g_strdup_printf("%.*s%s%.*s", 3 - slow, "---", "W0GCJ", 3 - slow, "+++"); g_printf("%s%c", str, '\n'); g_free(str); }