Path: utzoo!mnetor!uunet!husc6!bbn!uwmcsd1!uwmacc!uwvax!oddjob!gargoyle!ihnp4!homxb!houdi!marty1
From: marty1@houdi.UUCP (M.BRILLIANT)
Newsgroups: comp.lang.c
Subject: Re: Address of Array
Message-ID: <1445@houdi.UUCP>
Date: 14 Dec 87 15:05:05 GMT
References: <126@citcom.UUCP> <2550034@hpisod2.HP.COM> <1854@haddock.ISC.COM> <9735@mimsy.UUCP>
Organization: AT&T Bell Laboratories, Holmdel
Lines: 28
Summary: I have no problems with address of array element

In article <9735@mimsy.UUCP>, chris@mimsy.UUCP (Chris Torek) writes:
> ... in the near future, one will be able to write the following:
> ...
> 		p = g() ? &z[0] : &z[2];
> ...
> At present, it is necessary to code this using casts (because &z[0]
> elicits warnings or errors about & before array), or using ....

Not so on the vax-785 with SV_R2 I'm logged in on now.  I can write
    ...
    char *a, b[14];
    ...
    a = &b[3];
    ...
without getting any complaints from the compiler.  It does what I want,
too: skips the beginning of the array.

Writing &b without an index in brackets still draws a warning from the
compiler that & before an array is ignored.  The storage location where
the array begins is known to the compiler by the name b, but since that
address is not accessible as data at run time, &b has no meaning.

Of course, writing &a draws no warnings, because a is a pointer, and
has both a value and a location where the value is stored.

M. B. Brilliant					Marty
AT&T-BL HO 3D-520	(201)-949-1858
Holmdel, NJ 07733	ihnp4!houdi!marty1