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

Discussion

Which of the following statements is true?

  • A.User has to explicitly define the numeric value of enumerations
  • B.User has a control over the size of enumeration variables.
  • C.Enumeration can have an effect local to the block, if desired
  • D.Enumerations have a global effect throughout the file.

Answer: C

Correct answer: Enumeration can have an effect local to the block, if desired

An enum declared inside a block is visible only within it, exactly like any other declaration - so its effect can be local. The other statements are false: the compiler assigns values automatically from 0 unless you override them, the size of an enum variable is the implementation’s choice, and an enum is not necessarily file-wide.

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

Post your comment

Please log in or register to post a comment.