Changeset 784deab for src/examples/twice.c
- Timestamp:
- Jan 8, 2016, 10:37:10 PM (9 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, string, with_gc
- Children:
- 61f9356
- Parents:
- 1cced28
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/examples/twice.c
r1cced28 r784deab 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.