O'Reilly logo

C# Primer Plus by Klaus Michelsen

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Enumerator Operators

Listing 7.5 showed how to apply the operators assignment (=), equals (==), and increment (++) to enumerators. Numerous other operators can be used with enumerators; they are listed in Table 7.4.

Table 7.4. Operators Applicable to Enumerators
Binary +, -
Unary ++, --, ~
Comparison operators ==, !=, <, >, <=, >=
Logical &, |, ^
Assignment =, +=, -=
Primary sizeof

You have not met all of the symbols displayed in Table 7.4. The operators relevant to enumerators are included here for completeness and overview; they will be discussed in relation to enumerators in due time.

The binary operators + and - cannot be applied to two enumerator types. Instead, they are meant to combine one enumerator operand with one integer value operand, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required