I'm really confused about the need for declaring a function in C.
When I write(define) a function of this type
there is no need for any declaration. Direct definition would do.
int fun(int, int, ...); or
void fun(int, int..)
But the moment, the return type/ any of the arguments is not void/int, it gives me an error message indicating the need for declaration. For example
This function needs a declaration like
int fun(float a)
printf("\nFloat value = %f",a);
Why is this ?
PS : Throughout the post, I am talking about definitions after main. If definitions were written before main, there is no need for any declarations,right. Just a disclaimer.