- Timestamp:
- May 3, 2016, 9:30:55 AM (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, with_gc
- Children:
- 7937abf, a1d6d80
- Parents:
- e945826
- Location:
- src/examples
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/examples/fstream_test.c
re945826 r0638c44 10 10 // Created On : Wed May 27 17:56:53 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sun Mar 6 20:58:29201613 // Update Count : 5412 // Last Modified On : Mon May 2 15:25:54 2016 13 // Update Count : 61 14 14 // 15 15 -
src/examples/sum.c
re945826 r0638c44 10 10 // Created On : Wed May 27 17:56:53 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Fri Mar 4 15:06:47 201613 // Update Count : 19 612 // Last Modified On : Mon May 2 15:07:57 2016 13 // Update Count : 198 14 14 // 15 15 … … 48 48 } // for 49 49 sout | "sum from" | low | "to" | High | "is" 50 | (int)sum( size, a ) | " " | ", check" | (int)s | endl;50 | (int)sum( size, a ) | ", check" | (int)s | endl; 51 51 52 52 int s = 0, a[size], v = low; … … 56 56 } // for 57 57 sout | "sum from" | low | "to" | High | "is" 58 | sum( size, (int *)a ) | " " | ", check" | (int)s | endl;58 | sum( size, (int *)a ) | ", check" | (int)s | endl; 59 59 60 60 float s = 0.0, a[size], v = low / 10.0; … … 64 64 } // for 65 65 sout | "sum from" | low / 10.0 | "to" | High / 10.0 | "is" 66 | sum( size, (float *)a ) | " " | ", check" | (float)s | endl;66 | sum( size, (float *)a ) | ", check" | (float)s | endl; 67 67 68 68 double s = 0, a[size], v = low / 10.0; … … 72 72 } // for 73 73 sout | "sum from" | low / 10.0 | "to" | High / 10.0 | "is" 74 | sum( size, (double *)a ) | " " | ", check" | (double)s | endl;74 | sum( size, (double *)a ) | ", check" | (double)s | endl; 75 75 76 76 struct S { int i, j; } 0 = { 0, 0 }, 1 = { 1, 1 }; … … 87 87 } // for 88 88 sout | "sum from" | low | "to" | High | "is" 89 | sum( size, (S *)a ) | " " | ", check" | (S)s | endl;89 | sum( size, (S *)a ) | ", check" | (S)s | endl; 90 90 } // main 91 91
Note: See TracChangeset
for help on using the changeset viewer.