can you explain how to chack all the char inside the array without check only the first and it says equal

for(j=0;j<len;j++)
            {
                if (letter==copywords[j])
                {
                    //words[j]=copywords[j];
                    words[j]=letter;
                    cout << "good guess: " << words[j] << endl;   //correct
                }
                else if(words[j]==copywords[j])) /problem
                {   
                    cout << "done!!!" << endl;
                    system ("pause");
                    exit(0);
                }
                else if(!letter) //here don' t go to else
                {
                    count++;
                    hangman(count);
                }
            }

help me

can you explain how to chack all the char inside the array without check only the first and it says equal

use a counter or a boolean, if one of the letters is not equal return false or change the value of the counter, and later use that boolean or counter for a specific task like printing equal or not

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.