Ok, I have a question now for real
I want to provide a list of strings to hold player profile names for selection. I had two ideas for this. One was to use std::string and just provide a list of strings. This doesn't work with DarkGDK; apparently there are library conflicts? So my other idea was to use a pointer to a pointer, char **. Hahaha yeah that didn't work either. It keeps causing heap corruptions.
char **listItems;
int count = 0;
int populateList () {
listItems = (char **) malloc (1);
listItems[count] = (char *) malloc (strlen ("test") + 1);
strcpy (listItems[count], "test");
for (int i = count; i < 10; i++) {
char **temp = (char **) realloc (listItems, ++count);
if (temp == NULL)
break;
listItems = temp;
listItems[count] = (char *) malloc (strlen ("test") + 1);
strcpy (listItems[count], "test");
}
}
This is a very crude example of what I am trying to do. If anyone has a suggestion as how to implement this sort of functionality I would appreciate it!!!