Well you see, altho the code execution starts from the main function, the code gets compiled from the top to the bottom of the code. For example if two functions are calling each other, it doesnt matter which function is calling first, the other function will not be defined by the time the compiler reaches it's function call.Thank you rasenove, but lets try to take this in the direction of classes. I am good with the function prototype ( its human understandable), but things get twisted when it comes to classes/modules if one is building a lib.
So prototypes are made so that the compiler can define its funtions before starting to compile.
The prototypes work as a reference to it's funtion for the compiler.