Hi im making a ai program for scrabble and cant get my string to = another string
here is my code and I marked it with a **HERE**
Code:#include <fstream> #include <iostream> #include <cstring> using namespace std; struct Words { char str[30]; }; int main() { char str[30]; string word[32000]; int i = 0; ifstream b_file ( "Final.txt" ); while(!b_file.eof()) { b_file>> str; word[i] = str; i++; } b_file.close(); string finallist[32000]; int count = 0; int letters = 0; string phrase = "EDW"; int x = 0; for(letters = 0;letters<=phrase.length();letters++) { for(count = 0;count<=i;count++) { if(word[count][0] == phrase[letters]) { strcpy(finallist[x],word[count]); //**HERE** x++; } } } cout<< "Reduced to this many words " << x << endl; system("pause"); return EXIT_SUCCESS; }