Changes between Version 1 and Version 3 of Ticket #8


Ignore:
Timestamp:
Sep 27, 2018, 2:50:01 PM (3 years ago)
Author:
Thierry Delisle
Comment:

Updated code.

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #8 – Description

    v1 v3  
    11{{{
    2 forall( otype T | { void ?{}( T *, zero_t ); T ?+?( T, T ); } )
     2forall( otype T | { void ?{}( T &, zero_t ); T ?+?( T, T ); } )
    33  T sum( int n, T a[] ) {
    4     T total = (T){0};           // instantiate T, select 0
     4    T total = 0;                // instantiate T, select 0
    55    for ( int i = 0; i < n; i += 1 )
    66        total = total + a[i];   // select +