source:
tests/enum_tests/voidEnum.cfa
@
c778ef1
Last change on this file since c778ef1 was 9b140bd, checked in by , 6 months ago | |
---|---|
|
|
File size: 626 bytes |
Rev | Line | |
---|---|---|
[12df6fe] | 1 | #include <fstream.hfa> |
[9b140bd] | 2 | #include <enum.hfa> |
[12df6fe] | 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 | ||
[9b140bd] | 11 | char* a[voidEnum] = { |
12 | "A", | |
13 | "B", | |
14 | "C" | |
15 | }; | |
[12df6fe] | 16 | |
17 | int main() { | |
18 | enum voidEnum v_1 = a; | |
19 | enum voidEnum v_2 = b; | |
[9b140bd] | 20 | sout | "Two different Opague Enum Should not be the same:"; |
[12df6fe] | 21 | if ( v_1 == v_2 ) { |
[9b140bd] | 22 | sout | "a and b are Equal" | nl; |
[12df6fe] | 23 | } else { |
[9b140bd] | 24 | sout | "a and b are Not Equal" | nl; |
[12df6fe] | 25 | } |
[9b140bd] | 26 | sout | "Default Output:"; |
27 | sout | a; | |
28 | sout | b; | |
29 | ||
30 | sout | labelE(v_1); | |
31 | sout | labelE(v_2); | |
32 | ||
[12df6fe] | 33 | } |
Note: See TracBrowser
for help on using the repository browser.