Question
#include<stdio.h>
int main()
{
extern int i;
i = 20;
printf("%d`setminus`n", sizeof(i));
return 0;
}
What would be the output of the program in 16 bit platform (Turbo C under DOS)?
#include<stdio.h>
int main()
{
extern int i;
i = 20;
printf("%d`setminus`n", sizeof(i));
return 0;
}
Answer: Option D
Was this answer helpful ?
Linker Error : Undefined symbol 'i'
The statement 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.
Was this answer helpful ?
More Questions on This Topic :
Question 1.
By default a real number is treated as a
....
Question 2.
What is the output of the program
#includ....
Question 7.
Which of the following statements should be ....
Question 10.
What is the output of:
#include<stdio.h>
main()
....
Submit Solution