Did my code differently from the example, but seems to work

For the challenge I did it a bit differently and ran into a few errors that I eventually worked out. Not sure if this will cause issues later on, though it is a bit longer than the example.

Is this before or after your fixes?

After, but I don’t get any errors

Well this is something that’s worth pointing out

string GetGuess()
{
	cout << "Enter your guess: ";
	string Guess = "";
    getline(cin, Guess);

    //prints the guess back
    string Printback();
    cout << "You Guessed: " << Guess << endl;
    return Guess;
}

string Printback()
{
	return string();
}

The Printback function does nothing, removing the function and function call will achieve the same effect.

1 Like