Machine-translated by Google. Questions are authored in English.
Top

Discussion

How many bytes are occupied by near, far and huge pointers (DOS)?

  • A.near=2 far=4 huge=4
  • B.near=4 far=8 huge=8
  • C.near=2 far=4 huge=8
  • D.near=4 far=4 huge=8

Answer: A

Correct answer: near=2 far=4 huge=4

These are the pointer types of the segmented 16-bit DOS memory model. A near pointer holds a 16-bit offset within the current segment and occupies 2 bytes. A far pointer holds both segment and offset and occupies 4.

A huge pointer is also 4 bytes but is normalised on every arithmetic operation, so it can address across segment boundaries correctly where a far pointer wraps within its segment. The distinction disappeared with flat 32-bit addressing, and the keywords are of historical interest only.

No comment is present. Be the first to comment.
Loading…

Post your comment

Please log in or register to post a comment.