Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!mit-eddie!uw-beaver!ubc-cs!alberta!mts.ucs.UAlberta.CA!Al_Dunbar From: userAKDU@mts.ucs.UAlberta.CA (Al Dunbar) Newsgroups: comp.lang.c Subject: Re: (Ab)using pointers to const objects Message-ID: <1709@mts.ucs.UAlberta.CA> Date: 17 Oct 90 03:36:36 GMT References: <1990Oct15.115003.29238@micrognosis.co.uk> Organization: MTS Univ of Alberta Lines: 23 In article <1990Oct15.115003.29238@micrognosis.co.uk>, nreadwin@micrognosis.co.uk (Neil Readwin) writes: >I am trying to understand what I can do with pointers to const and non-const >objects. The VAX C manual (not much of a reference, I admit) says 'if you >attempt to access a const object using a pointer to that object not declared >const then the result is undefined'. > >I am uncertain whether 'not declared const' applies to 'object' or >'pointer', but I assume it means 'object'. > I disagree. If it is a 'const object' then it must have been declared so, otherwise it must be something other than a const object. Ask a bunch of grammarians if 'not declared object' refers to 'that object' or 'a pointer to that object', and I bet the majority will answer 'a pointer to that object'. If any grammarians E-mail me their opinions, I will post a summary to the net (but only if I'm proved right, of course :-) ). -------------------+------------------------------------------- Al Dunbar | Edmonton, Alberta | this space for rent CANADA | -------------------+------------------------------------------- #! r