C++ Programmers, please help

#include
#include

using namespace std;

int main() {

//introduce to the game

constexpr int WORD_LENGTH = 5;

cout << "Welcome to Bulls and Cows\n"; 
cout << "Can you guess the " << WORD_LENGTH;
cout << " letter isogram I'm thinking of\n";
cout << endl;

// get the guess from the player
cout << "Enter your guess: ";
string Guess = "";
cin >> Guess;

//repeat guess back to them
cout << "This is your guess: " << Guess << endl;


cout << endl;
return 0;

}

Please help me fix this code. When you run the program, it should let user enter the guess and than it will output his guess. When it runs it says it is an error. please help!

You seem to be missing your iostream include

What error and please use code formatting. Highlighting the text and pressing the </> button

Have you include the string and the iostream at the top of you program. You do this by #include and on a new ling #inlcude with no ; at the end of the line. I hope this help.

Without code formatting #include <string> will look like "#include "

Thanx for the tip

Privacy & Terms