Changeset 784deab for src/examples/identity.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/identity.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:16:30 201513 // Update Count : 212 // Last Modified On : Mon Jan 4 23:38:05 2016 13 // Update Count : 6 14 14 // 15 15 … … 23 23 int main() { 24 24 ofstream *sout = ofstream_stdout(); 25 char c = 'a'; 26 c = identity( c ); 27 sout << c << ' ' << identity( c ) << '\n'; 28 int i = 5; 29 i = identity( i ); 30 sout << i << ' ' << identity( i ) << '\n'; 31 double d = 3.2; 32 d = identity( d ); 33 sout << d << ' ' << identity( d ) << '\n'; 25 sout | "char\t\t\t" | identity( 'z' ) | endl; 26 sout | "signed int\t\t" | identity( 4 ) | endl; 27 sout | "unsigned int\t\t" | identity( 4u ) | endl; 28 sout | "signed long int\t\t" | identity( 4l ) | endl; 29 sout | "unsigned long int\t" | identity( 4ul ) | endl; 30 sout | "signed long long int\t" | identity( 4ll ) | endl; 31 sout | "unsigned long long int\t" | identity( 4ull ) | endl; 32 sout | "float\t\t\t" | identity( 4.0f ) | endl; 33 sout | "double\t\t\t" | identity( 4.0 ) | endl; 34 sout | "long double\t\t" | identity( 4.0l ) | endl; 34 35 } 35 36 36 37 // Local Variables: // 37 38 // tab-width: 4 // 38 // compile-command: "cfa identity.c fstream.o iostream.o " //39 // compile-command: "cfa identity.c fstream.o iostream.o iterator.o" // 39 40 // End: //
Note: See TracChangeset
for help on using the changeset viewer.