ALLInterview.com :: Home Page            
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
Google
   
 
Categories >> Code Snippets >> Programming Code >> C Code
 
 


 

 
 C Code interview questions  C Code Interview Questions (401)
 C++ Code interview questions  C++ Code Interview Questions (121)
 VC++ Code interview questions  VC++ Code Interview Questions (2)
 Java Code interview questions  Java Code Interview Questions (57)
 Dot Net Code interview questions  Dot Net Code Interview Questions (113)
 Visual Basic Code interview questions  Visual Basic Code Interview Questions (8)
 Programming Code AllOther interview questions  Programming Code AllOther Interview Questions (37)
Question
main()

   {

	extern int i;

	i=20;

      printf("%d",i);

   }
 Question Submitted By :: C-Code
I also faced this Question!!     Answer Posted By  
 
Answer
# 1
Answer :

Linker Error : Undefined symbol '_i'

Explanation:

extern storage class in the following declaration,

extern int i;

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 i is available in any other
program with memory space allocated for it. Hence a linker
error has occurred .
 
Is This Answer Correct ?    25 Yes 3 No
Susie
 

 
 
 
Other C Code Interview Questions
 
  Question Asked @ Answers
 
What is the hidden bug with the following statement? assert(val++ != 0);   1
void main() { int i=5; printf("%d",i++ + ++i); }   3
main( ) { void *vp; char ch = ‘g’, *cp = “goofy”; int j = 20; vp = &ch; printf(“%c”, *(char *)vp); vp = &j; printf(“%d”,*(int *)vp); vp = cp; printf(“%s”,(char *)vp + 3); }   1
char *someFun1() { char temp[ ] = “string"; return temp; } char *someFun2() { char temp[ ] = {‘s’, ‘t’,’r’,’i’,’n’,’g’}; return temp; } int main() { puts(someFun1()); puts(someFun2()); }   1
How to read a directory in a C program?   4
How will you print % character? a. printf(“\%”) b. printf(“\\%”) c. printf(“%%”) d. printf(“\%%”) HCL 4
void main() { char a[]="12345\0"; int i=strlen(a); printf("here in 3 %d\n",++i); }   3
What is the output of the program given below main() { signed char i=0; for(;i>=0;i++) ; printf("%d\n",i); }   1
main() { struct student { char name[30]; struct date dob; }stud; struct date { int day,month,year; }; scanf("%s%d%d%d", stud.rollno, &student.dob.day, &student.dob.month, &student.dob.year); }   1
#define max 5 #define int arr1[max] main() { typedef char arr2[max]; arr1 list={0,1,2,3,4}; arr2 name="name"; printf("%d %s",list[0],name); }   1
Write a c program to search an element in an array using recursion Wipro 1
int i=10; main() { extern int i; { int i=20; { const volatile unsigned i=30; printf("%d",i); } printf("%d",i); } printf("%d",i); }   1
 
For more C Code Interview Questions Click Here 
 
 
 
 
 


   
Copyright Policy  |  Terms of Service  |  Articles  |  Site Map  |  RSS Site Map  |  Contact Us
   
Copyright © 2013  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  KalAajKal.com