How do I combine 2 C-Style Strings into an if statement
How do I combine two c-style strings together?
Basically I'm trying to see if the first letter is in the dictionary... then if it is.. check if the first and second letter are in the dictionary.. and if it is... check if the first, second, and third letter are in the dictionary... and so on and so forth.
I'm just displaying the code I'm having trouble with. The rest of the code works I'm just having trouble with the line 8 if statement. I know I'm using strncat wrong (never used it before). Idk if I'm correctly using it.
You call strcmp() to compare two character arrays, == doesn't work like it does for std::string class. To solve your problem you will have to first combine the two characters like I showed you in your other thread and then call strcmp() to compare it with another character array. Can't be done all in the same code statement.