string code[4] = {"G", "O", "B", "R"};
string colorPegs[6] = {"R", "B", "Y", "G", "O", "B"};
string userGuess;
getline(cin,userGuess);
Those are the important lines of code in my question.
The user will input 4 letters, for example "BBYG"
How can I make a for loop that checks the first char of user input with the first char of code, and sees if it matches?
for example:
string code is GOBR
user inputs BBBR. In user input, only one letter matches the code, which is the third B, how can I check for this with a for loop?