Define enumeration in computer programming, C/C++ Programming

Assignment Help:

Define Enumeration in Computer Programming?

Enumerated types enclose a list of constants that are able to be addressed in integer values.

We can declare variables and types as follows.

enum days
{
mon, tues, ..., sun
} week;

enum days week1, week2;

NOTE: As with arrays first enumerated name has index value 0. So mon has value 0, tues 1, etc.

week1 and week2 are variables.

We can define other values:

enum escapes
{
bell = `\a',
backspace = `\b',
tab = `\t',
newline = `\n',
vtab = `\v',
return = `\r'
};

We can also override the 0 start value:

enum months
{
jan = 1, feb, mar, ......, dec
};

Here it is implied that feb = 2 etc. 


Related Discussions:- Define enumeration in computer programming

CarDealership, ABC Car Dealership needs your help to update the ordering sy...

ABC Car Dealership needs your help to update the ordering system. This car dealer is selling four types of vehicles: Sedan, Truck, SUV, and mini Van. And each type of vehicle can h

Compass bearing, write a c program that converts compass bearings into dire...

write a c program that converts compass bearings into direction

What does extern mean in a function declaration in c++, It tells the compil...

It tells the compiler that a variable or a function exists, even if the compiler hasn't yet seen it in the file presently being compiled. This variable or function may be distinct

How many non-letters are included in the string, Write a fully modular C pr...

Write a fully modular C program that reads in a string of a defined size from the keyboard and reports how many times each letter of the alphabet occurs within that string (ignorin

What if one forget the [] when deleteing array allocated , What if one forg...

What if one forget the [] when deleteing array allocated through new T[n]? A: All life comes to a disastrous end. It is the programmer's responsibility not the compiler's to

In which condition a template a better solution than a base , In which cond...

In which condition a template a better solution than a base class? A: While you are designing a generic class to contain or manage objects of other types, while the format & beh

Define register variables - low level programming, Define Register Variable...

Define Register Variables - Low Level Programming? The Register variables are a special case of an automatic variable. The Automatic variables are allocated storage in the memo

Draw pie chart in c++ program, Draw pie chart in c++ program: int main...

Draw pie chart in c++ program: int main() {                 char cmd;                   cout                 cout                 cmd = toupper(getch());

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd