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

Roman code python help , In general, Roman numerals can be converted mathem...

In general, Roman numerals can be converted mathematically by simply assigning a numerical value to each letter, according to the chart below, and calculating a total: M=1000 | D=5

201 it, overloadstream insertion opertator to display the data of object on...

overloadstream insertion opertator to display the data of object on the console

Struct items, how to make a program this struct items/product

how to make a program this struct items/product

Write a program that simulates a simple calculation, The program reads two ...

The program reads two numbers and a character (operator). If the character is "+" then sum is displayed. If it is "-"then difference is displayed. If it is "*" then product is disp

Compiler designin liliting instruction, Ravi is a newbie to the programming...

Ravi is a newbie to the programming and while learning the programming language he came to know the following rules:

Write a program of inline function, Here is a program that uses an inline f...

Here is a program that uses an inline function to compute and return the absolute value of its input argument. # include inline int abs(int x) {                  ret

Guidelines or "rules of thumb" for overloading operators?, What are some gu...

What are some guidelines / "rules of thumb" for overloading operators? A: Here are a few guidelines / rules of thumb .Use common sense. If your overloaded operator makes life si

How to make a triangle number, i wont to make triangle with number but numb...

i wont to make triangle with number but number from the largest possible number to 01 (reversed).

Program for memory optimization of c / opencl code, Program for Memory Opti...

Program for Memory Optimization of C / OpenCL Code Project Description: This is possibly a very simple project for someone with an excellent knowledge of C and OpenCL. That,

C and Data structure, Implement multiple stacks in a single dimensional arr...

Implement multiple stacks in a single dimensional array using c.

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