Changeset 9b140bd
- Timestamp:
- May 7, 2024, 9:03:20 PM (7 months ago)
- Branches:
- master
- Children:
- 983f486
- Parents:
- 6d9aa79
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tests/enum_tests/voidEnum.cfa
r6d9aa79 r9b140bd 1 1 #include <fstream.hfa> 2 2 #include <enum.hfa> 3 3 enum() voidEnum { 4 4 a, b, c … … 9 9 }; 10 10 11 // void foo (const enum voidEnum & t){} 11 char* a[voidEnum] = { 12 "A", 13 "B", 14 "C" 15 }; 12 16 13 17 int main() { 14 18 enum voidEnum v_1 = a; 15 19 enum voidEnum v_2 = b; 16 // foo(b); 17 // enum voidEnum v_3 = 10; 18 // Error as int cannot convert to void enum 20 sout | "Two different Opague Enum Should not be the same:"; 19 21 if ( v_1 == v_2 ) { 20 sout | " Equal" | nl;22 sout | "a and b are Equal" | nl; 21 23 } else { 22 sout | " Not Equal" | nl;24 sout | "a and b are Not Equal" | nl; 23 25 } 24 sout | a | nl; 25 sout | b | nl; 26 sout | "Default Output:"; 27 sout | a; 28 sout | b; 29 30 sout | labelE(v_1); 31 sout | labelE(v_2); 32 26 33 }
Note: See TracChangeset
for help on using the changeset viewer.