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

Discussion

What is the size of int in C on a 32-bit system ?

  • A.1 byte
  • B.2 bytes
  • C.4 bytes
  • D.8 bytes

Answer: C

On a 32-bit system an int is usually 4 bytes.

The C standard only requires int to be at least 16 bits, leaving the exact size to the compiler. On 32-bit (and most 64-bit) platforms, compilers make int 32 bits, which is 4 bytes, matching the natural word size of the processor.

2 bytes was the size of int on old 16-bit compilers such as Turbo C under DOS. 1 byte is the size of a char, and 8 bytes is typical of long long or of double.

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

Post your comment

Please log in or register to post a comment.