What are enumeration types?

Having alot of trouble understanding this. So its a way of making your own data type, and they are constants meaning their value never changes throughout the program. Also a tutorial was saying you can change the value of the constant like:
enum blah
{
blah1 So it always increments by one right?
blah2
blah5 But if you change it intentionally then
blah6 it starts incremeting from there.
I dont understand this and my biggest trouble is understanding what it would be used for?? As far as i know the value has no meaning? I am so lost :-{ and Im sure probably everything Ive said makes no sense, so please help me out
Enumerations are just a way of creating data types and giving potential values to those data types.

For example, you might want a status type that stores whether or not function calls are successful.
1
2
3
4
5
6
7
8
9
10
11
12
13
// enum
enum status_t { SUCCESS, FAIL };

// implementation
status_t status;

// assuming DoStuff returns status_t
status = DoStuff();

if( status != SUCCESS )
{
   // failure
}


Topic archived. No new replies allowed.