BullCowGame S02 L18: None of my methods print!

I carefully arranged my code to look exactly as yours in the video, but it still only prints “Press any key to continue…”. I’ve attached screenshots of my code and output!

P.s. What is up with “new users can only attach one picture per post”?

The policy is no doubt to prevent spam, since most spammers register, post, and never come back (the ultimate “new user”).

The only possibility I can think of is noticing that the “main.cpp” tab has a “*” on it, indicating it is not saved. So, make sure you save, and compile. (If Visual Studio 2015, press F7 and you should see the compilation messages in the log window).

Just saw this on Udemy and answered. Pasted my answer from there in case anyone else runs into this.

Solution:
You are declaring functions again rather than using them. In main, remove the void/string types from the statement.

int main()
{
    PrintIntro();
    GetGuessAndPrintBack();
    GetGuessAndPrintBack();
    cout << endl;
    return 0;
}
2 Likes

Privacy & Terms