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

Explain nested classes, Nested Classes Many a times, it becomes essenti...

Nested Classes Many a times, it becomes essential to have a class contain properties of two other classes. One way is to explain a class within another - that is a class with m

Assigment, Hi is there any chance to get assignment for fresher tutor

Hi is there any chance to get assignment for fresher tutor

Programming, write a program that can accept numbers and perform all the fo...

write a program that can accept numbers and perform all the four arithmetic operation

Program to calculate gross pay and tax payable, Study the following table u...

Study the following table used to compute the tax payable by employees in certain organization   Gross Pay                                  Fewer than Three             Three

Destructor, Destructor: The purpose of destructor is to free the memory...

Destructor: The purpose of destructor is to free the memory when the compiler memory is reduced or not enough to execute certain program. Sometimes there may several objects op

Smuggler, Smugglers are becoming very smart day by day. Now they have devel...

Smugglers are becoming very smart day by day. Now they have developed a new technique of sending their messages from one smuggler to another. In their new technology, they are send

Can you think of a condition where your program would crash , Can you think...

Can you think of a condition where your program would crash without attaining the breakball, which you set at the straining of main()? A: C++ let for dynamic initialization of g

Procedure to add two numbers in a recursive manner, (a) Write a procedure c...

(a) Write a procedure called (add x y) that adds two numbers in a recursive manner. Specifically, note that x + y = (x + 1) + (y - 1) and x + 0 = x. (b) Using the substitution m

Recursion, Given a string, print all possible palindromic partitions using ...

Given a string, print all possible palindromic partitions using recursion

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