Why is this 5 sticking around?

Alright, so I am slowly understanding this and I am following along. However, so far I am having this weird error. Now in the video when setting the number of Guesses and tries, when he was doing the Guesses left, the number was 5. So 5 showed above enter your guess.

Then we worked on Tries left, which read Try 1. then enter your guess. When I run the Game, it has a 5 above Try 1. Enter your guess.

When Ben ran the Game the 5 was gone and it just said Try 1. enter your guess.

I have rewatched the videos multiple times to figure out if I put a number in the wrong place. From my knowledge the code is exact.

Below are the screenshots.

Main.cpp

FBullCowGame.h

FBullCowGame.cpp

Result…

This is my first class in coding so although I am a fast learner I can sometimes make bad mistakes. Sorry if this is a simple fix that I am missing. Or maybe this is supposed to be how it is. Any help would be greatly appreciated.

Thanks

R-

Hi Rampage,

Please take a closer look at your PlayGame() method in Main.cpp file.

You’re initializing MaxTries variable and then outputting it, which results in the number 5 above “Your guess was:” text.

If you’re wondering from where that 5 comes - you’ve declared and initialized MyMaxTries private variable in the FBullCowGame class interface (FBullCowGame.h), and FBullCowGame::GetMaxTries method returns that variable.

I understand how I got it. When I was following along in the videos when we first assign a number to max tries, in the video that 5 shows up. I did same and a 5 shows up. Then later on in the video when we are adding the try 1. “enter guess”, on Bens video the 5 is gone and mine is still there. I rewatched the video many times and the code I have is the exact same as his, however a 5 is showing up for me and not on his video. I was wondering if I missed something.

There was a cut at 4:38 and the code has been removed

Good look’n out. I appreciate it. Thanks everyone for assisting me.