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

  1. Path: sparky!uunet!cs.utexas.edu!sun-barr!ames!data.nas.nasa.gov!mustang.mst6.lanl.gov!ucsbcsl!mcl!ucosmo
  2. From: ucosmo@mcl.ucsb.edu (Boris Burtin)
  3. Newsgroups: comp.lang.c++
  4. Subject: Reference to a pointer??
  5. Keywords: pointer, reference
  6. Message-ID: <ucosmo.716157377@mcl>
  7. Date: 10 Sep 92 20:36:17 GMT
  8. Sender: root@ucsbcsl.ucsb.edu
  9. Lines: 21
  10.  
  11. I have not been able to dig up any information on how to change a pointer 
  12. inside a function (aside from the good old dual-pointer C solution).  I know
  13. that, for example, an int can be changed in a function like so:
  14.  
  15. void f(int& i)
  16. {
  17.     i = 0;
  18. }
  19.  
  20. So why can't you do this:
  21.  
  22. void f(int& *p)
  23. {
  24.     p = 0;
  25. }
  26.  
  27. Or do I just have the syntax wrong?
  28.  
  29. --
  30.      - Boris
  31. (cosmo@cs.ucsb.edu)
  32.