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

Explain how can you tell whether a program was compiled using c versus c++?

567


What is the value of a[3] if integer a[] = {5,4,3,2,1}?

656


How can I make sure that my program is the only one accessing a file?

665


How do you define a string?

645


How many parameters should a function have?

655






string reverse using recursion

1799


What are c header files?

568


What is difference between && and & in c?

561


What is a null string in c?

575


What does 1f stand for?

600


Is c a great language, or what?

594


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

605


What is the symbol indicated the c-preprocessor?

686


What is variable declaration and definition in c?

491


Is linux written in c?

590