Path: utzoo!attcan!uunet!microsoft!jimad From: jimad@microsoft.UUCP (Jim ADCOCK) Newsgroups: comp.object Subject: Re: C++ and garbage collection (Was: Re: What is Objective C?) Message-ID: <57475@microsoft.UUCP> Date: 17 Sep 90 18:49:07 GMT References: <1990Sep12.074154.657@tukki.jyu.fi> <1990Sep16.090226.11051@tukki.jyu.fi> Reply-To: jimad@microsoft.UUCP (Jim ADCOCK) Organization: Microsoft Corp., Redmond WA Lines: 17 In article <1990Sep16.090226.11051@tukki.jyu.fi> sakkinen@jytko.jyu.fi (Markku Sakkinen) writes: >To go for more nit-picking, one might quarrel about the "exact >equivalence". For instance, I suppose it is at least legal for >a pointer variable to advance just beyond the last element of an array, >otherwise C/C++ programmers couldn't employ their cherished >"*p++" idiom. This is covered on pgs 72-73 of E&S. Both pointers and array indexing allow one to refer to the location *one* beyond the high end of an array -- as long as you do not actually dereference that location. char a[10]; char* p1 = &a[10]; char* p2 = a+10; The assignments to p1 and p2 are both legal, and "equivalent." ....Which has little or nothing to do with C/C++ pointer hackery as actually practiced....