Screenshot of "string Guess" from Bulls and Cows

Here’s how I did mine. I was having some trouble because I forgot that in C++ the “<<” operand is required to string together (heh hehe) both strings and string objects. I originally had my code as:

cout << “Your guess was” Guess “.”; and was super puzzled when it told me it was expecting to see a “;” after Guess.

After I changed it to cout << “Your guess was” << Guess << “.”; all was right in the world.

BullsAndCowsGuessFromPlayer

Privacy & Terms