home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / lang / cplus / 13531 < prev    next >
Encoding:
Internet Message Format  |  1992-09-11  |  775 b 

  1. Path: sparky!uunet!mcsun!Germany.EU.net!pki-nbg!hitkw18!mhr
  2. From: mhr@hitkw18.pki-nbg.philips.de (Muharem Hrnjadovic)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: Reference to a pointer??
  5. Keywords: pointer, reference
  6. Message-ID: <mhr.716218309@hitkw18>
  7. Date: 11 Sep 92 13:31:49 GMT
  8. References: <ucosmo.716157377@mcl>
  9. Sender: news@pki-nbg.philips.de
  10. Lines: 29
  11.  
  12. ucosmo@mcl.ucsb.edu (Boris Burtin) writes:
  13.  
  14. >I have not been able to dig up any information on how to change a pointer 
  15. >inside a function (aside from the good old dual-pointer C solution).  ...
  16.  
  17.     .
  18.     .
  19.     .
  20.  
  21. >So why can't you do this:
  22.  
  23. >void f(int& *p)
  24. >{
  25. >    p = 0;
  26. >}
  27.  
  28. It should be the other way round :
  29.  
  30.     void f(int *& p)
  31.     {
  32.         p = 0;
  33.     }
  34.  
  35. now f() receives a reference to a pointer as its argument.
  36.  
  37. Regards,
  38.  
  39.  
  40.   -- Muharem
  41.