Examveda
Examveda

Determine Output:
void main()
{
      char far *farther, *farthest;
      printf("%d..%d", sizeof(farther), sizeof(farthest));
}

A. 4..2

B. 2..2

C. 4..4

D. 2..4

Answer: Option A

Solution(By Examveda Team)

The second pointer is of char type and is not a far pointer.


This Question Belongs to C Program >> C Miscellaneous

Join The Discussion

Comments ( 3 )

  1. The Monarch
    The Monarch :
    2 years ago

    wrong answer. please check again.

  2. RAVINA RAUNDALE
    RAVINA RAUNDALE :
    6 years ago

    I did not get this concept

  3. Kakkar Mohit
    Kakkar Mohit :
    7 years ago

    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.

Related Questions on C Miscellaneous