Changeset 784deab for src/examples/swap.c
- Timestamp:
- Jan 8, 2016, 10:37:10 PM (8 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/swap.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:34:47 201513 // Update Count : 112 // Last Modified On : Mon Jan 4 11:32:25 2016 13 // Update Count : 5 14 14 // 15 15 16 extern "C" { 17 int printf( const char *, ... ); 18 } 16 #include "fstream.h" 19 17 20 18 forall( type T ) … … 25 23 } 26 24 27 int main( ) {25 int main( void ) { 28 26 int x = 1, y = 2; 29 printf( "%d %d\n", x, y ); 27 ofstream *sout = ofstream_stdout(); 28 sout | x | ' ' | y | endl; 30 29 swap( &x, &y ); 31 printf( "%d %d\n", x, y );30 sout | x | ' ' | y | endl; 32 31 } 33 32 34 33 // Local Variables: // 35 34 // tab-width: 4 // 36 // compile-command: "cfa swap.c " //35 // compile-command: "cfa swap.c fstream.o iostream.o iterator.o" // 37 36 // End: //
Note: See TracChangeset
for help on using the changeset viewer.