Follow Our FB Page << >> for Daily Laughter. We Post Funny, Viral, Comedy Videos, Memes, Vines...



extern int i;




main() { extern int i; i=20; printf("%d",i); }..

Answer / susie

Answer :

Linker Error : Undefined symbol '_i'


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 ?    26 Yes 3 No

Post New Answer

More C Code Interview Questions

There is a lucky draw held every day. if there is a winning number eg 1876,then all possible numbers like 1867,1687,1768 etc are the numbers that match irrespective of the position of the digit. Thus all these numbers qualify fr the lucky draw prize Assume there is no zero digit in any numbers. write a program to show all the possible winning numbers if a "winning number"is passed as an arguments to the function.

1 Answers   Nagarro,

Is the following code legal? typedef struct a { int x; aType *b; }aType

1 Answers  

why the range of an unsigned integer is double almost than the signed integer.

1 Answers  

write a program to count the number the same (letter/character foreg: 's') in a given sentence.

2 Answers  

Given an array of characters which form a sentence of words, give an efficient algorithm to reverse the order of the words (not characters) in it.

2 Answers   Wipro,

main() { char * strA; char * strB = I am OK; memcpy( strA, strB, 6); } a. Runtime error. b. I am OK c. Compile error d. I am O

4 Answers   HCL,

how to programme using switch statements and fuctions, a programme that will output two even numbers, two odd numbers and two prime numbers of the users chioce.

0 Answers   Mbarara University of Science and Technology,

How to use power function under linux : for(i=1;i<=n;i++){ pow(-1,i-1)} since it alerts undefined reference to 'pow'.

2 Answers  

can u give me the c codings for converting a string into the hexa decimal form......

1 Answers  

Which one is taking more time and why ? :/home/amaresh/Testing# cat time.c //#include <stdio.h> #define EOF -1 int main() { register int c; while ((c = getchar()) != EOF) { putchar(c); } return 0; } ------------------- WIth stdio.h:- :/home/amaresh/Testing# time ./time_header hi hi hru? hru? real 0 m4.202s user 0 m0.000s sys 0 m0.004s ------------------ Witout stdio.h and with #define EOF -1 =================== /home/amaresh/Testing# time ./time_EOF hi hi hru? hru? real 0 m4.805s user 0 m0.004s sys 0 m0.004s -- From above two case , why 2nd case is taking more time ?

0 Answers  

how can i cast a char type array to an int type array

2 Answers  

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 Answers