Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!yale!cmcl2!brl-adm!umd5!uvaarpa!mcnc!rti!xyzzy!throopw From: throopw@xyzzy.UUCP (Wayne A. Throop) Newsgroups: comp.lang.c Subject: Re: Address of array Message-ID: <422@xyzzy.UUCP> Date: Thu, 3-Dec-87 13:48:58 EST Article-I.D.: xyzzy.422 Posted: Thu Dec 3 13:48:58 1987 Date-Received: Mon, 7-Dec-87 06:16:34 EST References: <126@citcom.UUCP> <163@mccc.UUCP> Organization: Data General, RTP NC. Lines: 28 > pjh@mccc.UUCP (Peter J. Holsberg) > OK - perhaps you had better tell us neophytes what you mean by the > address of an array! Same as address of anything else. It is an address which, when indirected, yields an array, and when "N" is added to it, yields the address of an array which is itself a member of an array "N" elements away from the array yielded by an indirection. A pointer to an integer array of 10 elements is declared by int (*a)[10]; and could be used like so a[N] /* Nth array of ten ints away from (*a) */ (*a)[N] /* Nth int in the array pointed to by a */ a[N][M] /* Mth int in the Nth array */ (*(a+N))[M] /* same as a[N][M] */ What could be simpler? -- Another interesting facet of ninja was the use of magic. They had a reputation as sorcerors and wizards who could fly and hypnotize, and walk through walls, and get away with huge deductions on their taxes. --- Bruce Israel martial-arts-request@brillig -- Wayne Throop!mcnc!rti!xyzzy!throopw