For loop Implementation

First I didn’t like that the function printed under get input/guess so instead of renaming it I simply separated it. After that I looked for ‘magic numbers’ and found one in the length so a quick google search revealed std::string.length(). This way I don’t have to worry about the number as the code finds it for me.

Used a few global scope variables here ‘Number of lives’ ‘Password’. These are likely covered in a future lesson.(made a wild guess on placement recalling Java rules.(years ago))

Hopefuly it’s ok that i am not following the lesson plan to the letter. Mostly i just never picked up C++, so learning the particulars of the language is awesome. here is my code.

You can declare the variable for the loop in the for loop like this

for(int i = 0; i < NumberOfHackingLives; i++)

Thanks, I had miss that. Corrected now. :slight_smile: