dynamic array parameters

Wayne Throop throopw at dg_rtp.UUCP
Fri Dec 27 05:47:51 AEST 1985


A small PS.  Naturally, the macro

> #define index(a,i,j)  (*(a + i*d1 + j))

really needs extra parenthesization, like so:

#define index(a,i,j) (*((a) + (i)*d1 + (j)))

or, (using subscripts) like so:

#define index(a,i,j) ((a)[(i)*d1 + (j)])
-- 
Wayne Throop at Data General, RTP, NC
<the-known-world>!mcnc!rti-sel!dg_rtp!throopw



More information about the Comp.lang.c mailing list