main()

{

extern int i;

i=20;

printf("%d",i);

}



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

Answer / susie

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

Post New Answer

More C Code Interview Questions

main ( ) { static char *s[ ] = {“black”, “white”, “yellow”, “violet”}; char **ptr[ ] = {s+3, s+2, s+1, s}, ***p; p = ptr; **++p; printf(“%s”,*--*++p + 3); }

1 Answers  


write the function. if all the character in string B appear in string A, return true, otherwise return false.

11 Answers   Google,


what is brs test reply me email me kashifabbas514@gmail.com

0 Answers  


write a simple calculator c program to perform addition, subtraction, mul and div.

0 Answers   United Healthcare, Virtusa,


Hi, i have a project that the teacher want a pyramid of numbers in C# or java...when we click a button...the pyramid should be generated in a listbox/or JtextArea...and the pyramid should have the folowing form: 1 232 34543 4567654 567898765 67890109876 7890123210987 890123454321098 90123456765432109 0123456789876543210 Plz help with codes...didn't find anything on the net.

0 Answers  






How to swap two variables, without using third variable ?

104 Answers   AB, ADP, BirlaSoft, Cisco, Cygnet Infotech, HCL, Hewitt, Honeywell, HP, IBM, Infosys, Manhattan, Microsoft, Mobius, Percept, Satyam, SofTMware, TCS, Wipro, Yamaha,


main() { int i=5; printf(“%d”,i=++i ==6); }

1 Answers  


what is oop?

3 Answers  


main() { unsigned char i=0; for(;i>=0;i++) ; printf("%d\n",i); }

1 Answers  


main() { show(); } void show() { printf("I'm the greatest"); }

2 Answers  


Ramesh’s basic salary is input through the keyboard. His dearness allowance is 40% of basic salary, and house rent allowance is 20% of basic salary. Write a program to calculate his gross salary.

1 Answers  


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

1 Answers  


Categories