If you define it globally (outside of main) before main, would you still need to declare it before using it? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

If you define it globally (outside of main) before main, would you still need to declare it before using it?

Or would the definition count as its declaration as well?

28th Jul 2016, 3:18 PM
Adriel
Adriel - avatar
1 Answer
+ 2
If the compiler reads the definition and/or declaration before you use the function, you are fine. Often you will have functions in header files.
29th Jul 2016, 12:31 PM
Nihle