Question 2
Back to Exercise
Is there any difference between extern int fun(); and int fun();?
- A Yes, the first one is a definition
- B No – function declarations have external linkage by default Correct
- C Yes, the second one is local to the file
- D The first is invalid
Correct Answer: Option B
Unless declared static, a function has external linkage, so extern on a function declaration is redundant. (In C23 both also mean "takes no parameters".)
Discussion & Comments 0
Share your method, a shortcut, or ask about a step you didn't follow.
No comments yet. Be the first to share your solution!