Which of the following is a characteristic of an enum in C++? 

  • It can store multiple values at once 
  • It is used for dynamic memory allocation 
  • It consists of a set of named integer constants 
  • It defines object behavior
An enum in C++ consists of a set of named integer constants. It allows for creating a new data type where each value is represented by a unique name rather than a numeric value, enhancing the readability of the code. This means that an enum can only hold one of the values that you've defined.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *