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


Please Help Members By Posting Answers For Below Questions

What are control structures? What are the different types?

596


Write a program to swap two numbers without using the third variable?

595


Why does the call char scanf work?

618


Can main () be called recursively?

627


Why do we use static in c?

632






Explain what are global variables and explain how do you declare them?

637


What does malloc () calloc () realloc () free () do?

559


how to count no of words,characters,lines in a paragraph.

3901


What are the 5 data types?

600


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.

1722


What is pointers in c?

652


Explain what is wrong with this program statement? Void = 10;

761


hello freinds next week my interview in reliance,nybody has an idea about it intervew questions..so tell

1672


What are derived data types in c?

608


State two uses of pointers in C?

638