- Timestamp:
- Jul 29, 2024, 9:49:07 AM (5 weeks ago)
- Branches:
- master
- Children:
- b67d7a5b
- Parents:
- b8e047a
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
doc/theses/mike_brooks_MMath/programs/hello-accordion.cfa
rb8e047a rcaa3e2c 9 9 10 10 forall( T, @[NprovTerty]@, @[Nmunicipalities]@ ) 11 struct Can adaPop {11 struct CanPop { 12 12 array( T, @NprovTerty@ ) provTerty; $\C{// nested VLA}$ 13 13 array( T, @Nmunicipalities@ ) municipalities; $\C{// nested VLA}$ … … 19 19 20 20 forall( T, [NprovTerty], [Nmunicipalities] ) 21 void ?{}( T &, Can adaPop( T, NprovTerty, Nmunicipalities ) & this ) {}21 void ?{}( T &, CanPop( T, NprovTerty, Nmunicipalities ) & this ) {} 22 22 23 23 forall( T &, [NprovTerty], [Nmunicipalities] ) 24 void ^?{}( Can adaPop( T, NprovTerty, Nmunicipalities ) & this ) {}24 void ^?{}( CanPop( T, NprovTerty, Nmunicipalities ) & this ) {} 25 25 26 26 … … 39 39 40 40 forall( T, [NprovTerty], [Nmunicipalities] ) 41 void check( Can adaPop( T, NprovTerty, Nmunicipalities ) & pop ) with( pop ) {41 void check( CanPop( T, NprovTerty, Nmunicipalities ) & pop ) with( pop ) { 42 42 total_pt = total_mun = 0; 43 43 for ( i; NprovTerty ) total_pt += provTerty[i]; … … 60 60 int main( int argc, char * argv[] ) { 61 61 const int npt = ato( argv[1] ), nmun = ato( argv[2] ); 62 @Can adaPop( int, npt, nmun ) pop;@62 @CanPop( int, npt, nmun ) pop;@ 63 63 // read in population numbers 64 64 @check( pop );@ … … 71 71 Total province/territory: 36,991,981 72 72 Total municipalities: 36,991,981 73 $\$$ ./a.out 13 3654 74 Total province/territory: 36,991,981 75 Total municipalities: 36,991,981 73 76 */ 74 77
Note: See TracChangeset
for help on using the changeset viewer.