Discussion
A record has fields of widths 4, 8 and 2 bytes laid out in that order with no padding. What offset does the third field occupy?
Answer: C
Correct answer: 12
With no padding the offsets are cumulative from zero: the first field at 0, the second at 4, and the third at \( 4 + 8 = 12 \). The offset is the running total of the widths before the field, which is why the third field’s own width of 2 does not enter the calculation.
No comment is present. Be the first to comment.
Loading…
Post your comment
Please log in or register to post a comment.
Examination Categories
- SSC Exams
- Banking Exams
- Teaching Exams
- Civil Services Exams
- Railways Exams
- Engineering Recruitment Exams
- Defence Exams
- State Government Exams
- Police Exams
- Insurance Exams
- Nursing Exams
- Other Government Exams
- NRA CET
- PG Entrance Exams
- Campus Placement
- MBA Entrance Exams
- CUET and UG Entrance
- Judiciary Exams
- Regulatory Body Exams
- Software Development