home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / lang / cplus / 16362 < prev    next >
Encoding:
Text File  |  1992-11-16  |  1.1 KB  |  31 lines

  1. Path: sparky!uunet!ogicse!uwm.edu!cs.utexas.edu!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!clipper.cis.ohio-state.edu!beery
  2. From: beery@clipper.cis.ohio-state.edu (brian david beery)
  3. Newsgroups: comp.lang.c++
  4. Subject: Simple question: class objects & pointers
  5. Message-ID: <1992Nov16.162130.11475@cis.ohio-state.edu>
  6. Date: 16 Nov 92 16:21:30 GMT
  7. Article-I.D.: cis.1992Nov16.162130.11475
  8. Sender: news@cis.ohio-state.edu (NETnews        )
  9. Organization: The Ohio State University Dept. of Computer and Info. Science
  10. Lines: 19
  11.  
  12. I am new to C++, and have a question regarding pointers and class objects:
  13. The following code:
  14. class cl_object
  15. {public:
  16.   int value;
  17. }
  18. generic_function(cl_object *o)
  19. {
  20.   *o.value=0;
  21. }; 
  22.  
  23. causes an error message, to the effect that the right side of the '.' must
  24. be a structure.  (I am using Borland C++, if that matters.)  How do I access
  25. member data of an object referenced by a pointer?
  26.                            
  27.                                  Thanks in advance,
  28.                                    Brian D. Beery
  29.                                    Ohio State University
  30.            
  31.