home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!zaphod.mps.ohio-state.edu!sol.ctr.columbia.edu!spool.mu.edu!agate!doc.ic.ac.uk!uknet!fulcrum!bham!bhamvx!mccauleyba
- From: mccauleyba@vax1.bham.ac.uk (Brian McCauley)
- Newsgroups: comp.lang.c++
- Subject: Re: Simple question: class objects & pointers
- Message-ID: <1992Nov17.125809.1@vax1.bham.ac.uk>
- Date: 17 Nov 92 12:58:09 GMT
- References: <1992Nov16.162130.11475@cis.ohio-state.edu>
- Sender: usenet@rs6000.bham.ac.uk (USENET News Service)
- Organization: University of Birmingham
- Lines: 16
-
- In article <1992Nov16.162130.11475@cis.ohio-state.edu>, beery@clipper.cis.ohio-state.edu (brian david beery) writes:
- > *o.value=0;
- > causes an error message, to the effect that the right side of the '.' must
- > be a structure. (I am using Borland C++, if that matters.) How do I access
- > member data of an object referenced by a pointer?
- What you have here is a precedence problem
- `*o.value' means `*(o.value)' what you want is `(*o).value'
-
- Most of the time `(*o).value' is abbrieviated `to o->value'
- --
- \\ ( ) No Bullshit! | Email: B.A.McCauley@bham.ac.uk
- . _\\__[oo from | Voice: +44 21 471 3789 (home)
- .__/ \\ /\@ /~) /~[ /\/[ | Fax: +44 21 625 2175 (work)
- . l___\\ /~~) /~~[ / [ | Snail: 197 Harborne Lane,
- # ll l\\ ~~~~ ~ ~ ~ ~ | Birmingham, B29 6SS, UK
- ###LL LL\\ (Brian McCauley) | ICBM: 52.5N 1.9W
-