Symbols that can perform operations on values or variables are known as operators. For example +, -, =, %, << etc. Cout operator (<<) is used to print the output to the screen. Operands are the values or the variable on which operators perform operations. Every operator has its own function/task. Sometimes the wrong operator can cause errors.
No operator “<<” matches these operands C++
Availability of the definitions in header files may cause this error. Some definitions are available in one header file but the operator is not available in that header file.
using namespace std;
vector<string> words; //some random string
while (used.find(guess) != string::npos)
Here, we have a string in the presence of header file iostream. Unfortunately iostream contains the definitions for the string but it does not contain << operator.
To resolve this error you have to add an extra header file called #include <string>. This header file contains all the definitions and the operator related to the strings.
Hope this will help.