home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / lang / cplus / 18304 < prev    next >
Encoding:
Text File  |  1992-12-22  |  1.1 KB  |  48 lines

  1. Newsgroups: comp.lang.c++
  2. Path: sparky!uunet!zaphod.mps.ohio-state.edu!rpi!ghost.dsi.unimi.it!valentm
  3. From: valentm@ghost.dsi.unimi.it (marco valentini)
  4. Subject: prototyping object?
  5. Organization: Computer Science Dep. - Milan University
  6. Date: Tue, 22 Dec 1992 11:45:24 GMT
  7. Message-ID: <1992Dec22.114524.421@ghost.dsi.unimi.it>
  8. Summary: I need a prototyping for object
  9. Lines: 37
  10.  
  11.  
  12. I have written the following code:
  13. class paolo;  //!Is Right this ??????
  14. object pippo
  15. {
  16.   paolo* p;
  17.   public:
  18.    void ....
  19.    ..... (various methods)
  20.  
  21. }
  22. object paolo
  23. {
  24.   pippo* pi;
  25.   public:
  26.    int ...
  27.    ...(variuos methods)
  28. }
  29.  
  30. then I have do pippoobj=new pippo
  31.            paoloobj=new paolo
  32. then the constructor of two object assign the value of pippoobj->pi=paoloobj
  33. paoloobj->p=pippoobj
  34. but when I access to the pippo's methods via pi the compiler tell me that
  35. pippo obj don't have this methods.
  36. where is my error (I think in prototiping the class paolo with class paolo;)
  37.  
  38.             Thanks to anyone want help me.
  39.  
  40.  
  41.                 Valentini Marco
  42.                 Dip. Scienze Informazione
  43.                 Univ. Milano (IT)
  44.  
  45.                 Mail at valentm@pippo.sm.dsi.unimi.it
  46.  
  47.  
  48.