home *** CD-ROM | disk | FTP | other *** search
- Path: doc.ic.ac.uk!not-for-mail
- From: mdf@doc.ic.ac.uk (Martin Frost)
- Newsgroups: comp.sys.amiga.programmer
- Subject: Re: Referances troubble
- Date: 26 Feb 1996 17:07:20 -0000
- Organization: Dept. of Computing, Imperial College, University of London, UK.
- Distribution: world
- Message-ID: <4gspc8$dj4@oak42.doc.ic.ac.uk>
- References: <1266.6624T117T1455@himolde.no>
- Reply-To: mdf@doc.ic.ac.uk (Martin Frost)
- NNTP-Posting-Host: oak42.doc.ic.ac.uk
- X-Newsreader: mxrn 6.18-23
-
-
- In article <1266.6624T117T1455@himolde.no>, Espen.Berntsen@himolde.no (Nameless) writes:
-
- >void Tester(void &Testering)
- >{
- > printf("%i\n",Testering);
- > Testering = AllocMem(100, MEMF_CHIP|MEMF_CLEAR);
- > printf("%i\n",Testering);
- >}
-
- >void main(void)
- >{
- > void *Test;
- >
- > printf("%i\n",Test);
- > Tester(Test);
- >
- > printf("%i\n",Test);
- >// FreeMem(Test, 100);
- >}
-
- If I understand you correctly, this is the sort of thing you need:
-
- void func(void **p1, void **p2)
- {
- printf("%lx,%lx\n",p1,p2);
- p1 = AllocMem(100,MEMF_CHIP|MEMF_CLEAR);
- p2 = AllocMem(200,MEMF_ANY);
- printf("%lx,%lx\n",p1,p2);
- }
-
- int main(void) /* NOTE WELL: main() returns an _int_ */
- {
- void *p1,*p2;
- printf("%lx,%lx\n",p1,p2);
- func(&p1,&p2);
- printf("%lx,%lx\n",p1,p2);
- if(p1) FreeMem(p1,100);
- if(p2) FreeMem(p2,200);
- return(0);
- }
-
- Martin
-