C Programming - Declarations and Initializations - Discussion
Discussion Forum : Declarations and Initializations - Yes / No Questions (Q.No. 2)
2.
Suppose a program is divided into three files f1, f2 and f3, and a variable is defined in the file f1 but used in files f2 and f3. In such a case would we need the extern declaration for the variables in the files f2 and f3?
Discussion:
46 comments Page 5 of 5.
Anson Cardoz said:
9 years ago
No variables defined in f1. So it should be declared as extern.
Pavan kumar said:
1 decade ago
We want to declare the variable extern in file f1 or f2?
Sowmya said:
9 years ago
No, variables defined in f1 so it should be declared.
Pavan said:
9 years ago
No variables defined in f1 so it should be declared.
Apurva said:
1 decade ago
Because extern is act as the global declaration.
C.kumar said:
7 years ago
Can anyone please explain with example?
(1)
Post your comments here:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers