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

  1. Newsgroups: comp.sys.amiga.programmer
  2. Path: news2.interlog.com!rose!awhite
  3. From: awhite@user.rose.com (A White)
  4. Subject: Re: Referances troubble
  5. Sender: news@rose.com (news)
  6. Organization: Rose Media Incorpoarted, Ontario, Canada
  7. Message-ID: <Dn94Ly.FB5@rose.com>
  8. References: <1266.6624T117T1455@himolde.no>
  9. Date: Fri, 23 Feb 1996 23:15:33 GMT
  10.  
  11. In article <1266.6624T117T1455@himolde.no>,
  12. Nameless <Espen.Berntsen@himolde.no> wrote:
  13. >Ok, I have aslight problem with references. The problem is that I have to pass a
  14. >few pointers to a subroutine, where things are done to them, and then they are
  15. >passed back. Now, what I hoped would work was something like this
  16. >
  17. >void Tester(void &Testering)
  18.  
  19. I hope you are using C++, because this is not a C construct
  20.  
  21. >    void *Test;
  22. >
  23. >    Tester(Test);
  24. >
  25. >//   FreeMem(Test, 100);
  26.  
  27. If you are using  C++, then Tester should be (I'm guessing at this, but try it)
  28.     void Tester( void& *Testering )
  29. because you want a reference to a pointer to void, which matches the type
  30.     void *Test;
  31.  
  32. If you are using C, try:
  33.     void Testering( void **Testering 
  34.     {
  35.         *Testering = AllocMem...
  36. and
  37.     Tester( &Test );  within main
  38.  
  39.         
  40.  
  41.