home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / sys / amiga / programmer / 3734 < prev    next >
Encoding:
Text File  |  1996-08-05  |  1.2 KB  |  46 lines

  1. Path: news.ox.ac.uk!news
  2. From: Nick Christie <nick.christie@oucs.ox.ac.uk>
  3. Newsgroups: comp.sys.amiga.programmer
  4. Subject: Re: Referances troubble
  5. Date: 22 Feb 1996 14:42:03 GMT
  6. Organization: Oxford University Computing Services
  7. Message-ID: <4ghvbr$qbm@news.ox.ac.uk>
  8. References: <1266.6624T117T1455@himolde.no>
  9. NNTP-Posting-Host: nick.oucs.ox.ac.uk
  10. Mime-Version: 1.0
  11. Content-Type: text/plain; charset=us-ascii
  12. Content-Transfer-Encoding: 7bit
  13. X-Mailer: Mozilla 1.2N (Windows; I; 16bit)
  14.  
  15. Espen.Berntsen@himolde.no wrote:
  16. >Ok, I have aslight problem with references. The problem is that I have to pass a
  17. >few pointers to a subroutine, where things are done to them, and then they are
  18. >passed back. Now, what I hoped would work was something like this
  19. [snip]
  20.  
  21. Why not pass a "pointer to a pointer" to the function, which then
  22. modifies it indirectly:
  23.  
  24. void main()
  25. {
  26. void *ptr;
  27.  
  28. Test(&ptr);
  29.  
  30. FreeVec(ptr);
  31. }
  32.  
  33. void Test(void **ptrp)
  34. {
  35. *ptrp = AllocVec(256,MEMF_ANY);
  36. }
  37.  
  38. Nick
  39. -- 
  40. Nick Christie, IT Support,     mailto://nick.christie@oucs.ox.ac.uk
  41. Oxford University Computing Services,   http://sable.ox.ac.uk/~nick
  42. 13 Banbury Road, Oxford OX2 6NN.     Opinions expressed are my own.
  43. "There are no more bugs in my program." -- Anon.
  44.  
  45.  
  46.