C Programming - Declarations and Initializations - Discussion

Discussion Forum : Declarations and Initializations - General Questions (Q.No. 4)
4.
Is there any difference between following declarations?
1 : extern int fun();
2 : int fun();
Both are identical
No difference, except extern int fun(); is probably in another file
int fun(); is overrided with extern int fun();
None of these
Answer: Option
Explanation:

extern int fun(); declaration in C is to indicate the existence of a global function and it is defined externally to the current module or in another file.

int fun(); declaration in C is to indicate the existence of a function inside the current module or in the same file.

Discussion:
56 comments Page 6 of 6.

Suraj said:   7 years ago
Thanks for explaining the answer.

Vijay said:   1 decade ago
Why we use extern function in C?

Jhansi said:   8 years ago
What is extern? I can't get it.

Dulal said:   9 years ago
What is the global function?

Ashwini said:   1 decade ago
What is global function?

Chand890 said:   1 decade ago
What is extern?


Post your comments here:

Your comments will be displayed after verification.