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 4 of 6.

Raj said:   1 decade ago
Can anyone tell me how can we access one C program to another one with external variable.

Rishikumar said:   1 decade ago
How can we declare functions with extern keyword and how can we access that function ?

Nagarjuna said:   1 decade ago
How can we declare functions with extern keyword and how can we access that function ?

Pradeep bhupathi said:   2 decades ago
Extern is a keyword which is used to define any variable or function in externally.

Sruthi said:   9 years ago
Is the variable declared as extern similar to the variable declared under main?

Sirisha said:   1 decade ago
What is global function and why extern keyword used to declare a function?

Arvind kumar said:   1 decade ago
It gives the address of memory location so we can use the specific value.

Sm das said:   1 decade ago
It is a keyword which functioning same as global and local variables.

Nancy said:   1 decade ago
While using extern keyword, memory is allocated to variable or not?

Revathi said:   10 years ago
What is the different between normal function and extern function?


Post your comments here:

Your comments will be displayed after verification.