There is such code:
int analysis::_indexOfSymbol(char symbol, std::string* alphabet, int size) { for (int i = 0; i < size; ++i) { if(symbol == alphabet[i]) return i; } return NULL; } The compiler gives an error that it is impossible to compare the int and the строку . Although, symbol is a type of char (yes, it is the letter equivalent of the code, but nonetheless). I tried to convert symbol to string , but neither (std::string) symbol , nor std::string(symbol) , or std::string k = std::symbol(symbol) helped me. Likewise, I tried to convert alphabet[i] to char (ATTENTION! String values are stored in the array array, but they are single-character), but it didn't work for me because of the difference between the char* and char types.
The code that creates the alphabet looks like this:
this->alphabet[0] = "А"; this->alphabet[1] = "Б"; и т.д.
sizeof(alphabet)o_O And what do you think is the meaning of this expression? - VladDalphabetcreates led ... (and the words of the vehicle are just his words) - avpalphabetis indeed an array of pointers to strings, then in_indexOfSymbolalong with it, you must pass its size (or terminate this array with a null pointer (likeargv[]inmain()parameters) - avp