What we do to remove error??
#include<stdio.h>
extern int var;
main()
{
 var=10;
 return 0;
}*
Answer :
*Linker Error : Undefined  reference to 'var'
*
Explanation*:
extern storage class in the following declaration, extern int var; specifies
to the compiler that the memory for i is allocated in some  other program
and that address will be given to the current program at the  time of
linking. But linker finds that no other variable of name var is  available
in any other program with memory space allocated for it. Hence a linker
error has occurred .
*soution :* to remove error we have to eliminate the extern keyword before
the 'int'  at the declaring the var variable
with regardas
Madhusudan balai
indian institue of information techonology allahabd

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.

Reply via email to