What is enum?

  • Thread starter Thread starter Blue Man
  • Start date Start date
B

Blue Man

i'm confused! what exactly is this function type and where should i use it?
appreciate any answers, clear article or anything.
 
Enum is basic blue man, it's a concept you should know very well if you've
ever programmed. Enum allows you to define your own enumerated types. So you
can have weekdays = (monday, tuesday, wed... etc) where monday would be 0,
tuesday would be 1, and so on... this makes your code easier to read when
you intend to use integers to represent options. ie: instead of if(option ==
3) you'd have if(option == thursday).
 
C# Learner said:
An enumeration is a type which has a finite set of *possible* values
defined either implicitly or explicitly when it's created.

"when it (the enumeration) is defined", rather.
 
Back
Top