I am trying to write a hangman program that has only two functions other than main.
One of the functions:
void sethiddenword(c har hidden[]);
is supposed to randomly assign a word to hidden. I have a list of 10 words i would like to use but can't use a control statment to set one of them into the array.
So far i have written
void sethiddenword(c har hidden[]){
int rnum;
srand(time(0));
rnum = rand() %10;
}
This gives me the random number but i dont know how to assign the words to hidden. If you can do it with control statements i would like to see that. Either way, thanks.
One of the functions:
void sethiddenword(c har hidden[]);
is supposed to randomly assign a word to hidden. I have a list of 10 words i would like to use but can't use a control statment to set one of them into the array.
So far i have written
void sethiddenword(c har hidden[]){
int rnum;
srand(time(0));
rnum = rand() %10;
}
This gives me the random number but i dont know how to assign the words to hidden. If you can do it with control statements i would like to see that. Either way, thanks.
Comment