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

Pragma, How to specify different memory sections for a variable using #Prag...

How to specify different memory sections for a variable using #Pragma?

Padovan.., count the number of string in n-th padovan string

count the number of string in n-th padovan string

C program for even & odd no in any matrices , C Program for EVEN & ODD NO I...

C Program for EVEN & ODD NO IN ANY MATRICES #include stdio.h> #include conio.h> void main() {           int a[100][100];           int i=0,j=0,r,c,even=0,odd=0;

Is there any difficulty with the following : char*a=null; , Is there any di...

Is there any difficulty with the following : char*a=NULL; char& p = *a;? A: The result is indeterminate. You must never do this. A reference has to always refer to some object.

Luminous Jewels - The Polishing Game, Byteland county is very famous for lu...

Byteland county is very famous for luminous jewels. Luminous jewels are used in making beautiful necklaces. A necklace consists of various luminous jewels of particular colour. Nec

Describe what is a listener in java, Problem: (a) Show the Java approac...

Problem: (a) Show the Java approach to event processing by explaining how event handling works in Java. Make use of a suitable example to support your answer. (b) Describe

When should you use multiple inheritance, There are 3 acceptable answers: "...

There are 3 acceptable answers: "Never," "Rarely "and" When the problem domain cannot be accurately modelled any other way."

What is the use of pear in php, What is the use of PEAR in php? PEAR is...

What is the use of PEAR in php? PEAR is termed as PHP Extension and Application Repository. It provides structured library to PHP users and also gives provision for package mai

Develop a windows application to show computer hardware, - But with less fe...

- But with less features and more user-friendly (particularly for non-tech savvy users). - Software needed having a left menu with links (no pictures required) for every hardwar

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