Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site cyb-eng.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!godot!harvard!seismo!ut-sally!oakhill!cyb-eng!howard From: howard@cyb-eng.UUCP (Howard Johnson) Newsgroups: net.lang.c Subject: Re: &array Message-ID: <426@cyb-eng.UUCP> Date: Fri, 26-Oct-84 20:34:51 EST Article-I.D.: cyb-eng.426 Posted: Fri Oct 26 20:34:51 1984 Date-Received: Sun, 28-Oct-84 06:25:54 EST References: <22197810.8e4@apollo.uucp> <981@bbncca.ARPA> <524@wjh12.UUCP> <> <394@ncoast.UUCP> <975@CSL-Vax.ARPA> <101@harvard.ARPA> Organization: Cyb Systems, Austin, TX Lines: 17 My first impression of the construct foo(&1) was that it should be classified as a feature which is a nonportable extension to C. But then I thought for a moment and it occurred to me that &1 can be handled by the compiler in a way quite similar to handling foo("hello") ! What happens is that foo("hello") causes the compiler to allocate and initialize a character array and use it's (constant) address as a parameter. Likewise, foo(&1) could cause the compiler to allocate a unique cell (an int), initialized with the value 1, and pass *that* (constant) address as a parameter. Note that this does *not* imply that array declarations (e.g. bar[10]) get space allocated for a pointer to that array's address. Howard Johnson ..!ut-sally!cyb-eng!howard P.S.: I can just see a program similar to xstr used to put all instances of &1 definitions into the same place, so that every &1 points to the same place... :-)