Jul 28, 2013 at 6:35pm UTC
Show how worde is defined and what value it was assigned
By the way at first you are using variable with name worde but in the last statement you are outputing variable with name word . Is it a typo or you indeed output another variable by mistake?
Last edited on Jul 28, 2013 at 6:39pm UTC
Jul 28, 2013 at 6:43pm UTC
I actually just fixed it, but I had the same problem in a hangman game I am working.
1 2 3 4 5 6 7
string guessingword[4] = {"_" , "_" , "_" , "_" };
string wordanswer[1];
string wordtotal[1];
wordanswer[0] = wordlist[randword];
wordtotal[0] = guessingword[0] + guessingword[1] + guessingword[2] + guessingword[3];
cout << wordanswer;
The output was similar to the other one.
Thank you!
Last edited on Jul 28, 2013 at 6:47pm UTC
Jul 28, 2013 at 6:43pm UTC
Yeah like vlad said, it looks like a type.
Jul 28, 2013 at 6:48pm UTC
Oh, It was:
int randword = rand() % 9;
Jul 28, 2013 at 7:13pm UTC
Just fixed it again, sorry I put you to the trouble.
Thank you!