home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / lang / cplus / 16423 < prev    next >
Encoding:
Internet Message Format  |  1992-11-17  |  1.4 KB

  1. 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
  2. From: mccauleyba@vax1.bham.ac.uk (Brian McCauley)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: Simple question: class objects & pointers
  5. Message-ID: <1992Nov17.125809.1@vax1.bham.ac.uk>
  6. Date: 17 Nov 92 12:58:09 GMT
  7. References: <1992Nov16.162130.11475@cis.ohio-state.edu>
  8. Sender: usenet@rs6000.bham.ac.uk (USENET News Service)
  9. Organization: University of Birmingham
  10. Lines: 16
  11.  
  12. In article <1992Nov16.162130.11475@cis.ohio-state.edu>, beery@clipper.cis.ohio-state.edu (brian david beery) writes:
  13. >   *o.value=0;
  14. > causes an error message, to the effect that the right side of the '.' must
  15. > be a structure.  (I am using Borland C++, if that matters.)  How do I access
  16. > member data of an object referenced by a pointer?
  17. What you have here is a precedence problem
  18.   `*o.value' means `*(o.value)' what you want is `(*o).value'
  19.  
  20. Most of the time `(*o).value' is abbrieviated `to o->value'
  21. -- 
  22.     \\   ( )    No Bullshit!     |  Email: B.A.McCauley@bham.ac.uk   
  23.  .  _\\__[oo        from         |  Voice: +44 21 471 3789 (home)
  24. .__/  \\ /\@    /~)  /~[   /\/[  |    Fax: +44 21 625 2175 (work)
  25. .  l___\\      /~~) /~~[  /   [  |  Snail: 197 Harborne Lane,
  26.  # ll  l\\    ~~~~ ~   ~ ~    ~  |         Birmingham, B29 6SS, UK
  27. ###LL  LL\\   (Brian McCauley)   |   ICBM: 52.5N 1.9W
  28.