Changeset a56767c for src/examples/twice.c
- Timestamp:
- Jan 11, 2016, 2:53:01 PM (10 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, ctor, deferred_resn, demangler, enum, forall-pointer-decay, gc_noraii, jacob/cs343-translation, jenkins-sandbox, master, memory, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
- Children:
- 77acda06
- Parents:
- 974906e2 (diff), 61f9356 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)links above to see all the changes relative to each parent. - File:
-
- 1 edited
-
src/examples/twice.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/examples/twice.c
r974906e2 ra56767c 10 10 // Created On : Wed May 27 17:56:53 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed May 27 18:37:23 201513 // Update Count : 1 12 // Last Modified On : Mon Jan 4 11:32:04 2016 13 // Update Count : 10 14 14 // 15 15 … … 21 21 } 22 22 23 int main() { 23 int main( void ) { 24 // char does not have addition 25 char ?+?( char op1, char op2 ) { return (int)op1 + op2; } // cast forces integer addition or recursion 26 char ++?( char *op ) { *op += 1; return *op; } 27 char ?++( char *op ) { char temp = *op; *op += 1; return temp; } 28 24 29 ofstream *sout = ofstream_stdout(); 25 sout << twice( 1 ) << ' ' << twice( 3.2 ) << '\n';30 sout | twice( 'a' ) | ' ' | twice( 1 ) | ' ' | twice( 3.2 ) | endl; 26 31 } 27 32 28 33 // Local Variables: // 29 34 // tab-width: 4 // 30 // compile-command: "cfa twice.c fstream.o iostream.o " //35 // compile-command: "cfa twice.c fstream.o iostream.o iterator.o" // 31 36 // End: //
Note:
See TracChangeset
for help on using the changeset viewer.