My "For loop" screenshot

Using what tiny amount of coding I know from conversations with programmers, I have been putting my variables together at the top of my main.cpp instead of within the functions themselves so that they can be used wherever and so I can easily find them if I want to make changes. This seems to be biggest difference I am seeing between my code and what I am seeing in the lessons and others’ screenshots. Is there a reason why I shouldn’t continue organizing myself this way?

Privacy & Terms