[Freeciv-Dev] Re: newbie C question
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
On Tue, 5 Mar 2002, Ben Webb wrote:
> I think you mean ptr = fc_malloc(11 * sizeof(struct mystruct));
Yes, of course :)
> ptr = fc_calloc(11, sizeof(struct mystruct));
> if (ptr[0].ptr != NULL) free(ptr[0].ptr);
>
> Assuming struct mystruct has a "ptr" member, that should work,
> since calloc zeroes the memory.
NULL==0 is a valid assumption across all architectures and compilers?
Yours,
Per
"What we anticipate seldom occurs: but what we least expect generally
happens." -- Benjamin Disraeli
[Freeciv-Dev] Re: newbie C question, Raimar Falke, 2002/03/05
|
|