Changeset 42dcae7 for translator/examples/identity.c
- Timestamp:
- Nov 25, 2014, 9:16:10 AM (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, string, with_gc
- Children:
- 3848e0e
- Parents:
- d11f789
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
translator/examples/identity.c
rd11f789 r42dcae7 1 extern "C" { 2 int printf( const char *fmt, ... ); 3 } 1 #include "fstream.h" 4 2 5 3 forall( type T ) … … 9 7 10 8 int main() { 11 printf( "result of identity of 5 is %d\n", identity( 5 ) ); 12 return 0; 9 ofstream *sout = ofstream_stdout(); 10 char c = 'a'; 11 sout << c << ' ' << identity( c ) << '\n'; 12 int i = 5; 13 sout << i << ' ' << identity( i ) << '\n'; 14 double d = 3.2; 15 sout << d << ' ' << identity( d ) << '\n'; 13 16 } 17 18 // Local Variables: // 19 // compile-command: "../../bin/cfa identity.c fstream.o iostream.o" // 20 // End: //
Note: See TracChangeset
for help on using the changeset viewer.