Strcmp has been bugging me for a whole day now.
All of my strcmp are basically like that but it's not working. And I don't think it has to do with the char being inside a struct. It gives me a warning and when I run it it gives me a status access violation error.
1 2 3 4
if(strcmp(variable.players[variable.p].tiles[j], word[j])!=0){
printf("You don't have the letter %c\n",variable.players[variable.p].tiles[j]);
break;
}
As keskiverto suggested above, use string::find_first_of().
This will also serve as a gentle introduction to how a C++ programmer should take advantage of the C++ library.
Case in point, char arrays are remnants of good old C, and together with them, the entire string.h library (with strcmp(), strcpy() etc). As a C++ programmer you are encouraged to move up to std::string.