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

Discussion

The width of the plain type int in C is

  • A.the same as the width of a pointer on the target
  • B.at least 16 bits, and implementation defined beyond that
  • C.exactly 16 bits on every conforming implementation
  • D.exactly 32 bits on every conforming implementation

Answer: B

The standard sets a minimum and leaves the rest to the compiler, so it is sixteen bits on many 8-bit toolchains and thirty-two on most 32-bit ones. Depending on the width without saying so is one of the commonest portability faults.

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

Post your comment

Please log in or register to post a comment.