You cannot use a name / character that has not yet been declared. That is the whole reason.
This is true:
i = 10; //i not yet declared int i;
This is not true , for exactly the same reason. The compiler does not know that i is - it does not matter to him what it will be.
Just like you write this (which also makes sense for both you and the compiler):
int i; //declaration (and definition too!) i = 10; //use
you should write this:
void myFunction();
Hope this helps.
Nawaz source share