How to pass arbitrary 2-d array argument ?

Dave Elliott davee at hpcllla.cup.hp.com
Wed Jan 9 05:22:13 AEST 1991


I'm just a C novice, so maybe I'm way off base here... but isn't the solution
something like the following:

     madd(a, b, c, m, n)
     double *a, *b, *c;
     int m, n;
        {
         double *end;
         end = a + m * n;
         for ( ; a<end; ++a, ++b, ++c)
            *c = *a + *b;
        }
                      
                                         - Dave Elliott
                                           davee at hpda.hp.com



More information about the Comp.lang.c mailing list