The first member of an enum will be 0, and the value of each successive enum member is increased by 1. You can assign different values to enum member.
Enumerated (enum) types are data types that comprise a static, ordered set of values. They are equivalent to the enum types supported in a number of programming languages. An example of an enum type might be the days of the week, or a set of status values for a piece of data.
The default value of an enumeration type E is the value produced by expression (E)0 , even if zero doesn't have the corresponding enum member.
The default value of an enum E is the value produced by the expression (E)0 . Without overriding the default values, printing default(E) returns Foo since it's the first-occurring element.
I have noticed the following enum declaration while browsing some sample code. What does None=1 mean ?
public enum ButtonActions
{
None = 1,
Clear,
Insert,
Delete,
Cancel,
Close
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With