Changeset 94980502
- Timestamp:
- Mar 22, 2016, 10:19:00 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:
- 0438091
- Parents:
- 984dce6
- Location:
- src/examples
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
src/examples/constants.c
r984dce6 r94980502 10 10 // Created On : Wed May 27 17:56:53 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Mon Jan 25 23:44:12201613 // Update Count : 7612 // Last Modified On : Fri Mar 11 16:27:38 2016 13 // Update Count : 81 14 14 // 15 15 … … 44 44 0x_ff_FF_ff_FF_ff_FF_ff_FF; 45 45 9_223_372_036_854_775_807; 46 18_446_744_073_709_551_615 ;46 18_446_744_073_709_551_615UL; 47 47 3.141_59f; 48 48 3.14159; … … 53 53 L'\x_ff_ee'; 54 54 L_"\x_ff_ee"; 55 L"a_b\r\ Qyc\u_00_40 x_y_z\xff_AA";56 L_"a_b\r\ Qyc\u_00_40\55 L"a_b\r\vyc\u_00_40 x_y_z\xff_AA"; 56 L_"a_b\r\vyc\u_00_40\ 57 57 x_y_z\xff_AA"; 58 58 "abc" "def" "ghi"; -
src/examples/limits.c
r984dce6 r94980502 98 98 // Local Variables: // 99 99 // tab-width: 4 // 100 // compile-command: "cfa min.c" //100 // compile-command: "cfa limits.c" // 101 101 // End: // -
src/examples/searchsort.c
r984dce6 r94980502 11 11 // Created On : Thu Feb 4 18:17:50 2016 12 12 // Last Modified By : Peter A. Buhr 13 // Last Modified On : Wed Feb 17 12:21:04201614 // Update Count : 4613 // Last Modified On : Tue Mar 22 22:16:46 2016 14 // Update Count : 55 15 15 // 16 16 … … 36 36 sout | *v | ", "; 37 37 } // for 38 sout | endl | endl; 39 40 // descending sort/search by changing < to > 41 for ( unsigned int i = 0; i < size; i += 1 ) { 42 iarr[i] = i + 1; 43 sout | iarr[i] | ", "; 44 } // for 45 sout | endl; 46 { 47 int ?<?( int x, int y ) { return x > y; } 48 qsort( iarr, size ); 49 for ( unsigned int i = 0; i < size; i += 1 ) { 50 sout | iarr[i] | ", "; 51 } // for 52 sout | endl; 53 for ( unsigned int i = 0; i < size; i += 1 ) { 54 int *v = bsearch( size - i, iarr, size ); 55 sout | *v | ", "; 56 } // for 57 } 38 58 sout | endl | endl; 39 59
Note: See TracChangeset
for help on using the changeset viewer.