Path: utzoo!mnetor!uunet!lll-winken!lll-lcc!ames!umd5!brl-adm!brl-smoke!gwyn From: gwyn@brl-smoke.ARPA (Doug Gwyn ) Newsgroups: comp.lang.c Subject: Re: Question about type casting Message-ID: <7119@brl-smoke.ARPA> Date: 18 Jan 88 01:24:30 GMT References: <546@xyzzy.UUCP> <5080011@hpfcdc.HP.COM> Reply-To: gwyn@brl.arpa (Doug Gwyn (VLD/VMB) ) Organization: Ballistic Research Lab (BRL), APG, MD. Lines: 19 In article <5080011@hpfcdc.HP.COM> boemker@hpfcdc.HP.COM (Tim Boemker) writes: >2. Whenever an array identifier appears in an expression, it is treated as > being a pointer to the first element of the array. I can think of two exceptions to this: when the array name is the operand of sizeof or the operand of &. > Casting an expression > as an array is just asking that expression to be used as a pointer to the > base element of a (mutli-dimensional) rectangular collection of elements. How do you figure that? A cast operator is supposed to accomplish a virtual assignment of the operand into an object of the specified type, an array in this case, and we should all know that C does not support assignment into an array. > Saying that the resulting expression would > have to be a temporary array does not make sense under K&R, ... Excuse me, but saying anything else does not make sense.