Yes! Same thing here! It seems that the newer version of VS actually adds the prototype directly, theres also the detail about reviewing the modified main.cpp before it is “commited” into the code,and then you can click Promote to Document.
Like this:
Edit: It doesn’t add the return; line, as noted in the course as necessary. Probably a good idea to add it.
Edit2: It seems the declaration of the function is done regardless of promoting to document, I think it is there just so you see the declaration and the definition of the function at the same time.
Think of it as you called a function to PlayGame and in the middle of running it the function actually returned a result, and said “I’m done, I did what I was supposed to do, bye” the rest of the program just kept going until the end of the program. But when you put it outside the loop the function will only return a result after all the fuss is done on the for loop. So the game goes on.
So this is what I got instead what they show in the video when i use extract function, which if i’m looking at it seems to be just what you want by the end?