void main()
{
char far *farther,*farthest;
printf("%d..%d",sizeof(farther),sizeof(farthest));
}
Answer Posted / jaroosh
Some explanation first:
far pointers are outdated concepts from C, and are actually
compiler extentions, so you might get compiler errors trying
to use far pointers on some compilers.
In the program above,
farther's type - FAR pointer to char
farthest's type - near pointer to char
now, the difference in size of those stems from the fact
that far pointers consist of the segment and offset
together, while near pointers just have the offset.
Near pointers thus have size of 2 (just the offset), while
far pointers - size of 4 bytes.
Is This Answer Correct ? | 64 Yes | 4 No |
Post New Answer View All Answers
What are control structures? What are the different types?
Write a program to swap two numbers without using the third variable?
Why does the call char scanf work?
Can main () be called recursively?
Why do we use static in c?
Explain what are global variables and explain how do you declare them?
What does malloc () calloc () realloc () free () do?
how to count no of words,characters,lines in a paragraph.
What are the 5 data types?
Write a program in "C" to calculate the root of a quadratic equation ax^2+bx+c=0, where the value of a,b & c are known.
What is pointers in c?
Explain what is wrong with this program statement? Void = 10;
hello freinds next week my interview in reliance,nybody has an idea about it intervew questions..so tell
What are derived data types in c?
State two uses of pointers in C?