1234567891011121314
srand(time(NULL)); char* s1, * s2, * s3; char* s1_options[] = {"a", "b", "c", "d", "e"}; char* s2_options[] = {"1", "2", "3", "4", "5", "6"}; char* s3_options[] = {"more", "options", "etc"}; s1 = s1_options[rand() % (sizeof(s1_options) / sizeof(char*))]; s2 = s2_options[rand() % (sizeof(s2_options) / sizeof(char*))]; s3 = s3_options[rand() % (sizeof(s3_options) / sizeof(char*))]; char b[201]; sprintf(b, "%s: %s to the %s", s1, s2, s3); b[200] = 0; std::string result = std::string(b);