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

Discussion

Arithmetic operations such as addition, subtraction, multiplication and division are allowed on enumerated constants.

  • A.True
  • B.False

Answer: A

Correct answer: True

An enumerator is an integer constant and an enum variable an integer, so all the arithmetic operators apply to them. That is a strength and a weakness: convenient, but it means the compiler will not stop you adding a colour to a weekday.

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

Post your comment

Please log in or register to post a comment.