using namespace std;
int nl = 0;
int nw = 0;
int nc = 0;
cout << "Enter a word." << endl;
cin >> word;
for(int i = 0; i<10; i++)
if (word[i] != newword[i]
cout << "Guess a letter." << endl;
cin >> letter;
for (int i = nw; i<6; i++)
if (letter != word)
I am really stuck on this. I making a program to tell the number of letters in an inputted word and keep track of wrong and previously guessed correct letters. Right now I am trying to figure out how to insert letters from one array to another. Like, if a wrong letter is inputted how would I put it into the "wrong" array? Also how would I specify that if it is not any letter in the array, then it is wrong?
You can take a look at this. I basically edited your code to actually work but I did it quickly and didn't document it or test it thoroughly. I also didn't use any functions because it looks like you haven't learned them yet but I used a pointer.
I still don't understand why you would want them to enter a word and then guess it's letters. It's useless since they gave you the actual word. A more clever approach would be to give them a list of words and then randomly choose one for them to guess.