Xref: utzoo comp.lang.c:7861 comp.lang.fortran:509 Path: utzoo!mnetor!uunet!nuchat!sugar!peter From: peter@sugar.UUCP (Peter da Silva) Newsgroups: comp.lang.c,comp.lang.fortran Subject: Re: Conformant Arrays in C Message-ID: <1526@sugar.UUCP> Date: 6 Mar 88 15:30:04 GMT References: <42529@sun.uucp> Organization: Sugar Land UNIX - Houston, TX Lines: 40 Keywords: ANSI C Fortran In article <42529@sun.uucp>, dgh%dgh@Sun.COM (David Hough) writes: > void matmul(double a[?ar][?ac], /* ar >= p, ac >= q */ > double b[?br][?bc], /* br >= q, bc >= r */ > double c[?cr][?cc], /* cr >= p, cc >= r */ > int p, /* 0 <= p <= min(ar,cr) */ > int q, /* 0 <= q <= min(ac,br) */ > int r) /* 0 <= r <= min(bc,cc) */ WOw. I wouldn't have believed it... I prefer Fortran's syntax on this one. void matmul(double a[ar][ac], int ar, int ac, double b[br][bc], int br, int bc, double c[cr][cc], int cr, int cc, int p, int q, int r) { } Or: void matmul(a, ar, ac, b, br, bc, c, cr, cc, p, q, r) int ar, ac, br, bc, cr, cc, p, q, r; double a[ar][ac]; double b[br][bc]; double c[cr][cc]; { } Doesn't require any new operators, doesn't require passing descriptors around on the stack (yech), and allows you to allocate some space and give it different dimensions in different places. -- -- Peter da Silva `-_-' ...!hoptoad!academ!uhnix1!sugar!peter -- Disclaimer: These U aren't mere opinions... these are *values*.