In above option is D option correct??
in place of C
Vasudevan said:
(Wed, Aug 25, 2010 03:26:44 AM)
int a=20;(it is a outside of initialization)
how it consider for this program
Nandhi said:
(Fri, Sep 24, 2010 06:23:15 AM)
The variables are defined outside the main block, when that variable is declared as with the keyword 'extern'.
Murali Krishna said:
(Fri, Oct 22, 2010 04:49:51 AM)
What is the use of "extern" ?
Ravi Karthick said:
(Fri, Dec 3, 2010 08:42:36 PM)
Extern means external declaration that is declared for outside the function,so that a that is declared as extern and defined in outside the main ar a=20
Sindhu said:
(Thu, Mar 3, 2011 09:46:49 AM)
int a=20 is outside the main() so it is not considered as a declaration for a in given program
Prathyusha said:
(Sat, Mar 5, 2011 03:12:44 AM)
HI FRIENDS!
HERE IN THE PROGRAM PLEASE GO THROUGH THE QUESTION AGAIN.HE WAS JUST ASKING WHERE "a" IS DECLARED AND WHERE IT IS DEFINED.
WHETHER "a" IS NORMAL INTEGER OR EXTERNAL INTEGER NOT MATTERS.
SO,DECLARATION IS : extern int a;
AND DEFINITION IS :int a=20;
THAT'S IT!....
Why was declared int a=20 outside? suppose int a=20 declared inside of the function what is the o/p of this program?
Purnima said:
(Fri, Sep 9, 2011 05:13:24 PM)
Hi friends in my way if we declare extern int a;then we can use the variable a in any line or in may any function through out the programm, .
And if we declare int a;then it is local declaration here we can use a inside of the function only, if that function is closed then we can not use a in in another function.
Is it correct?
Aman said:
(Sun, Oct 2, 2011 12:28:39 AM)
When we have need to declare the extern variables? and what are its Benefits?
Bhavana said:
(Wed, Oct 5, 2011 02:50:35 PM)
I agree with prathyusha.
Mayank said:
(Tue, Nov 29, 2011 12:22:36 AM)
extern int a; indicates that the variable a is defined elsewhere, usually in a separate source code module.
printf("%d\n", a); it prints the value of local variable int a = 20. Because, whenever there is a conflict between local variable and global variable, local variable gets the highest priority. So it prints 20.
Rathika.B said:
(Sun, Dec 25, 2011 10:51:21 AM)
Please give an real example for "extern" keyword; Then only we know that how it works.