closed by
274 views
0 votes
0 votes
closed with the note: find the answer.

It is mandatory , the function should have prototype function in main because if the function is not declared at the point of the call, the compiler "guesses" (infers) the declaration implicitly from the types of the arguments passed in the call and assumes that the return type is int

My question is it gives syntactically error or compilation error or no error if we are not defining prototype function in main.

closed by

1 Answer

3 votes
3 votes
This guess was there only before C11 standard. Now, as per C11, it is a MUST that we should give prototype. Else, compiler may throw warning or error- it is up to compiler implementation.

Related questions

0 votes
0 votes
0 answers
1
himgta asked Feb 19, 2019
374 views
https://www.sanfoundry.com/c-program-checks-strings-anagrams/what is the meaning of line number 32?
1 votes
1 votes
1 answer
2
Satbir asked Jan 16, 2019
705 views
#define lol(a) a+a*aint main(void) { int a=3;printf("%d",lol(a+2)); return 0;}what is the output ?
0 votes
0 votes
0 answers
3
Shubham Aggarwal asked Sep 1, 2018
388 views
Please explain i am not able to understand it.
0 votes
0 votes
1 answer
4