Changeset 8bf9448
- Timestamp:
- Jul 20, 2021, 9:31:37 PM (3 years ago)
- Branches:
- ADT, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- d2260ad
- Parents:
- f9d8755
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tests/counter.cfa
rf9d8755 r8bf9448 10 10 // Created On : Thu Feb 22 15:27:00 2018 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Tue Nov 6 17:50:23 201813 // Update Count : 212 // Last Modified On : Tue Jul 20 21:25:30 2021 13 // Update Count : 4 14 14 // 15 16 #include <fstream.hfa> 15 17 16 18 // Tests unified increment/decrement builtin functions. … … 19 21 struct counter { int x; }; 20 22 21 counter& ?+=?( counter& c, one_t ) { ++c.x; return c; } 22 23 counter& ?-=?( counter& c, one_t ) { --c.x; return c; } 23 counter ?+=?( counter & c, one_t ) { ++c.x; return c; } 24 counter ?-=?( counter & c, one_t ) { --c.x; return c; } 24 25 25 26 int main() { … … 28 29 ++c; 29 30 c++; 30 printf("%d\n", c.x);31 sout | "inc" | c.x; 31 32 c -= 1; 32 33 --c; 33 34 c--; 34 printf("%d\n", c.x);35 sout | "dec" | c.x; 35 36 } 36 37
Note: See TracChangeset
for help on using the changeset viewer.