
Yet another newbie problem.
I have a global variable "word" which is a pointer to a char* chosen at runtime
I want to have another global pointer /char [] "guessed" which will be the same
size as "word" but I need to be able to change individual characters in it. Is
there an easy way to do this ?(I can't change the characters if its a pointer
and a char [] needs a constant value for the array size)
char *words[] = {"one","two","three"};
char *word
/* char *guessed;
...
srand(time(NULL));
int x = rand();
word = words[x%(sizeof words / sizeof words[0])];
/* Somehow get guessed to be same size as word but editable.
Thanks
Steve