What does extern mean in a function declaration?
Answers were Sorted based on User's Feedback
extern is significant only with data declarations. In
function declarations, it can be used as a stylistic hint
to indicate that the function's definition is probably in
another source file, but there is no formal difference
between
extern int f();
and
int f();
Is This Answer Correct ? | 91 Yes | 14 No |
Answer / poornima
extern is a keyword that is prefixed in function
declaration. It means tht function definition is in source
file.
for eg.
source file contains int sum(int x,int y) definition part.
To make use of this function in file by simply declare as
extern int sum(int ,int); is a good practice.
But to compiler happy extern sum(); is enough.
Is This Answer Correct ? | 34 Yes | 16 No |
Answer / zxg
(from MSDN)
Functions declared as extern are visible throughout all source files in the program (unless you later redeclare such a function as static). Any function can call an extern function.
Function declarations that omit the storage-class specifier are extern by default.
Is This Answer Correct ? | 4 Yes | 3 No |
Answer / aravind
Extern is nothing but a memory storage type.If we declare extern before the function than the variable can be accessed by that function not only locally but externally too.
extern int a=4
Int fun (int x)
{
x=a;
print gives a=4
Is This Answer Correct ? | 8 Yes | 19 No |
what is the output of the following program? #include<stdio.h> void main() { float x=1.1; while(x==1.1) { printf("\n%f",x); x=x-0.1; } }
program to find the ASCII value of a number
what is Structural oriented language? give some example of this language.....?
5. distance conversion: Convert a distance from miles to kilometers .there are 5280 feets per mile,12 inches per foot .2.54 centimeters per inch and 100000centimeters per kilometer
What is Full Form of C and Why We use C
What is structure in c explain with example?
number 2 plssssss help !!....using array.. turbo c.. create a program that will accept a number and determine if it is a happy number or an unhappy number.. example: enter a number : 7 7*7=49 then 4 and 9 4*4 and 9*9== 16 + 18 gives you 97 then 9 and 7 9*9 and 7*7 == 81 + 49 gives you 130 then 1 and 3 1*1 and 3*3 == 1 + 9 gives you 10 1*1 gives you 1 sample output: 7= 49= 16+81= 97= 81+49=130 =1+9=10 =1 "7 is a happy number" . if the last number is 2 then the number being inputed is not a happy number.
What is auto keyword in c?
How many bytes are occupied by near, far and huge pointers (dos)?
Who invented bcpl language?
Sir,please help me out with the output of this programme:- #include<stdio.h> #include<conio.h> void main() { int a=18,b=12,i; for(i=a<b?a:b;a%i||b%i;i--); printf("%d %d",i); }
A variable that is defined in a specified portion of a program but can be used throughout the program a) global variable b) local variable c) character d) none