Yes, my code works!

#include
using namespace std;

int main()
{
constexpr int WORD_LENGTH = 7;
cout << “Welcome to the Bulls and Cows! A fun word game!” << endl;
cout << "Can you guess the "; cout << WORD_LENGTH <<endl;
cout << “letter word I am thinking of?” << endl;
return 0;
}

// want to know how to get the player’s input - the word - something like cin >> something something -
// also the /n is there to create a space right? or like the enter key but it is just included in the text if you leave it in the quotation marks like is done in this tutorial. So i tried to do it outside of the “” and you get an error. It was like this - “”/n; - the only way to do it at this point (creating the enter like key) is to use << endl; - why is this?

Thats because you used “/n”!!! It is \n. - The difference was in the slash!

Privacy & Terms