+ 3

What if we declare a function after main function in c?

Calling function before declaration.

24th Jun 2019, 6:49 PM
Abhijeet Pawar
Abhijeet Pawar - avatar
6 Réponses
+ 5
you need a prototype first, before you can do that
24th Jun 2019, 7:00 PM
✳AsterisK✳
✳AsterisK✳ - avatar
+ 5
try it out in a code and see what happen, it's cool when you test things out yourself, it will be hard for you to forget
24th Jun 2019, 7:03 PM
✳AsterisK✳
✳AsterisK✳ - avatar
+ 3
In compilation process compiler invokes Linker and it links all the function calls with their definitions. Linker knows where the function implementation is.
24th Jun 2019, 10:17 PM
Nidhi
+ 2
I know but what happens ....if I don't declare or write prototype?
24th Jun 2019, 7:02 PM
Abhijeet Pawar
Abhijeet Pawar - avatar
+ 2
I did but it doesn't make any sense.....how can a compiler call a function before it's declaration?
24th Jun 2019, 7:04 PM
Abhijeet Pawar
Abhijeet Pawar - avatar