answersLogoWhite

0

An enumerated data type is a manufactured data type. The orginal implementation of the boolean data type was an enumerated type.

enum boolean {true, false};

this creates a type : boolean and two constants of type boolean: true and false.

true has an integer value: 0

false as an integer value: 1

The way boolean is now implemented in C and C++ and C# maintains the convention that 0 is true.

A common use of enumerated types is in game programming. You can enumerate the cardinal directions, for example, north, east, south, west, so that you can turn right by performing:

enum compass {north, east, south, west};

compass direction = west;

direction = (direction + 1) % 4

// at this point, direction would be equal to north, or 0

User Avatar

Wiki User

∙ 15y ago
User Avatar

What else can I help you with?

Related Questions

Do the elements of an enumerated data type have to be specified explicitly?

yes.


What does the term enum refer to in computer programming?

The term 'enum' is short for 'enumerated type'. An enumerated type is a data type containing a set of values called elements. They can also be called members or enumerators.


An enumerated data type is another user defined type which provide a way for attaching names to numbers thereby increase clearity of the code?

Yes. Enumerated types are constant values that are grouped under a common type.


Which type of power is exercised when Congress makes changes to the bankruptcy laws?

enumerated power


Which type of power is exercise when Congress declares war on another country?

enumerated power


What type of power id it that permits congress to declare war on a foreign nation?

Enumerated


What in enumerated powers?

Enumerated powers


What is the meaning of the term data domain?

In data management and database analysis, a data domain refers to all the unique values which a data element may contain. The rule for determining the data boundary may be as simple as a data type with an enumerated list of values.


What is gathering data and enumerate it?

Gathering data refers to the systematic collection of information for analysis and decision-making. It involves various methods such as surveys, interviews, observations, and experiments. The key types of data gathered can be enumerated as quantitative data (numerical values), qualitative data (descriptive information), primary data (collected firsthand), and secondary data (existing information from previous studies). Each type serves different purposes depending on the research objectives.


What are enumerated data types in pascal?

Pascal has 4 primitive data types: integer; boolean; char and; real. These 4 provide the basic building blocks for more complex types.


What did it mean if an item was on the enumerated list?

"Enumerated" means numbered. An enumerated list means a list which is ordered by numbering.


What is enumerated mean?

Enumerated means detailed, listed, specified, etc.