Last change
on this file since a4e1b09 was
5eb3f65,
checked in by Peter A. Buhr <pabuhr@…>, 8 weeks ago
|
change enumeration function names labelE, valueE, posE to label, value, posn
|
-
Property mode set to
100644
|
File size:
623 bytes
|
Line | |
---|
1 | #include <fstream.hfa> |
---|
2 | #include <enum.hfa> |
---|
3 | enum() voidEnum { |
---|
4 | a, b, c |
---|
5 | /*** |
---|
6 | * ,d = 10 // Disable; |
---|
7 | * //error: Enumerator of enum(void) cannot have an explicit initial value. |
---|
8 | */ |
---|
9 | }; |
---|
10 | |
---|
11 | char* a[voidEnum] = { |
---|
12 | "A", |
---|
13 | "B", |
---|
14 | "C" |
---|
15 | }; |
---|
16 | |
---|
17 | int main() { |
---|
18 | enum voidEnum v_1 = a; |
---|
19 | enum voidEnum v_2 = b; |
---|
20 | sout | "Two different Opague Enum Should not be the same:"; |
---|
21 | if ( v_1 == v_2 ) { |
---|
22 | sout | "a and b are Equal" | nl; |
---|
23 | } else { |
---|
24 | sout | "a and b are Not Equal" | nl; |
---|
25 | } |
---|
26 | sout | "Default Output:"; |
---|
27 | sout | a; |
---|
28 | sout | b; |
---|
29 | |
---|
30 | sout | label(v_1); |
---|
31 | sout | label(v_2); |
---|
32 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.