Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!uwvax!rutgers!mcnc!rti!xyzzy!throopw From: throopw@xyzzy.UUCP (Wayne A. Throop) Newsgroups: comp.lang.c Subject: meaning of "string constants" in C Message-ID: <231@xyzzy.UUCP> Date: Sat, 29-Aug-87 14:34:32 EDT Article-I.D.: xyzzy.231 Posted: Sat Aug 29 14:34:32 1987 Date-Received: Sun, 30-Aug-87 09:15:04 EDT References: <8877@brl-adm.ARPA> <8088@mimsy.UUCP> <87@splut.UUCP> Organization: Data General, RTP NC. Lines: 24 > jay@splut.UUCP (Jay Maynard) > In article <8088@mimsy.UUCP>, chris@mimsy.UUCP (Chris Torek) writes: >> Eventually it seems to dawn upon these programmers that >> "LDA" >> generates an anonymous character array holding the letters L, D, >> A, and NUL (\0) and evaluates to the address of this array. Oooooh! I didn't catch *THIS* the first time around. A small slip on (apparently) Chris's part, but an important distinction all the same. It does not, I repeat *NOT* evaluate to the address of the array. It evaluates to the address of the first element in the array, namely the 'L' in "LDA". Naturally, this distinction has important consequences when this array is used in subscripting or in pointer arithmetic. I hope everybody sees how "the address of the array" and "the address of the first element of the array" differ in these important ways. -- It is easy to find fault, if one has that disposition. There was once a man who, not being able to find any other fault with his coal, complained that there were too many prehistoric toads in it. --- Pudd'nhead Wilson's Calendar (Mark Twain) -- Wayne Throop !mcnc!rti!xyzzy!throopw