C | Functions | Question 8

What is the meaning of using extern before function declaration?

For example following function sum is made extern

extern int sum(int x, int y, int z)
{
    return (x + y + z);
}

(A) Function is made globally available
(B) extern means nothing, sum() is same without extern keyword.
(C) Function need not to be declared before its use
(D) Function is made local to the file.


Answer: (B)

Explanation: extern keyword is used for global variables. Functions are global anyways, so adding extern doesn’t add anything.

Quiz of this Question

Don’t stop now and take your learning to the next level. Learn all the important concepts of Data Structures and Algorithms with the help of the most trusted course: DSA Self Paced. Become industry ready at a student-friendly price.

My Personal Notes arrow_drop_up
Article Tags :
Practice Tags :


2


Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.