Amiga-C (34/223)

From:Stephen Illingworth
Date:10 Aug 2001 at 20:07:15
Subject:[amiga-c] Re: STRPTR + CopyMem

Hello Twelvebullets

On 10-Aug-01, you wrote:

> I thought that the memory for FileInfoBlock would be allocated
> automatically,

Your code wouldn't have worked even if the Examine() functions
did allocate the memory "automatically", as you're only passing a
pointer to the ExamineFH() function. You would need to pass the
address of the pointer to the FileInfoBlock. Thus,

struct FileInfoBlock * fibb;

ExamineFH (&fibb);

ExamineFH() would also need to be prototyped as following,

BOOL ExamineFH (BPTR, struct FileInfoBlock **);

Anyway, this is a moot point as we've established that
ExamineFH() just doesn't work like this, but it's a handy tip if
you ever need to allocate memory in a child function.

Regards, Steve

------------------------ Yahoo! Groups Sponsor ---------------------~-->
Small business owners...
Tell us what you think!
http://us.click.yahoo.com/vO1FAB/txzCAA/ySSFAA/dpFolB/TM
---------------------------------------------------------------------~->

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/