Multiple choice

According to the Standard C specification, what are the respective minimum sizes (in bytes) of the following three data types: short; int; and long?

  1. 1, 2, 2

  2. 1, 2, 4

  3. 1, 2, 8

  4. 2, 2, 4

  5. 2, 4, 8

Reveal answer Fill a bubble to check yourself
D Correct answer
Explanation

According to ANSI/ISO C standards, the minimum sizes are: short >= 2 bytes, int >= 2 bytes, long >= 4 bytes. Option D (2, 2, 4) meets these minimum requirements. The standards specify minimum sizes, allowing implementations to use larger sizes if desired.