Ok, so I follow the video word for word with the coding. When I started this, I copied everything Ben had me do, but for some reason I don’t get the same outcome he does. Instead, I get 0’s when I’m running the program. If anyone could help please.
Attached I included snippets of FBullCowGame.h and FBullCowGame.cpp BEFORE THE VIDEO. If need be I can include anything after the video or my main.cpp if that might have the problem.
@edwilke86 So I’ve decided to tackle it head on from the beginning. In the video, I am at the 2:30 timestamp and Ben is getting the value 666 outputted in the console window. I am not.
From this point in the video, Ben has only made the definition of FBullCowGame into the .cpp and put the ‘int MyCurrentTry’ and ‘int MyMaxTries’ into the “FBullCowGame::FBullCowGame(){}” code. After Ben does this, he gets the output of 666 in the console, but HOW? I am trying to see where I went wrong with my code and NOTHING.
@edwilke86 THIS IS FANTASTIC I AM SUCH AN IDIOT! Ok not in a bad way but I just figured it out. What I didn’t do was delete the ‘int’ from MyCurrentTry and MyMaxTry when I put it in the FBullCowGame::FBullCowGame code! See the code:
Before I had it set as integers but OBVIOUSLY that wouldn’t change because they are constants! (At least I hope that’s the answer… if not I have some serious studying to do) Anyway I have the correct outcome:
Awesome! Yeah, it’s usually something like that. The more mistakes you make, (and spend 30 minutes finding that you forgot a semicolon or something like that, and the compiler didn’t catch it to tell you) the more you learn, and the faster you get at it.