Static Voids after or before int MAIN()?
Posted: Tue Nov 26, 2019 7:02 pm
We all know that the main function of the program is int main (). So during the code I create other functions like void MoveSprites(), void CreatePlayer(), and so on.
I can create these functions before or after int main(), and if created after it, I have to set at the beginning of the code static void MoveSprites() and static void CreatePlayer() to be able to use these functions (because it doesn't even compile if not set).
Anyway, so far so good. My question is, when and what is the difference between putting the function before or after int main()? Is there any difference like "the commands you use always come later and the ones you only call once come before" ...?
And when should I use static before the void of the functions I created AFTER int main () ???
I can create these functions before or after int main(), and if created after it, I have to set at the beginning of the code static void MoveSprites() and static void CreatePlayer() to be able to use these functions (because it doesn't even compile if not set).
Anyway, so far so good. My question is, when and what is the difference between putting the function before or after int main()? Is there any difference like "the commands you use always come later and the ones you only call once come before" ...?
And when should I use static before the void of the functions I created AFTER int main () ???