[Discuss] Casting the return value of malloc bad?
Paul Nienaber
phox at phox.ca
Sat Jul 15 18:59:05 PDT 2006
Routines? Why would I want *more* code to do what I can do elegantly
with one malloc() call? I'm confused here. Also, using glib makes your
code non-portable, which is, IMNSHO, BS.
~p
George Farris wrote:
> On Sat, 2006-15-07 at 13:48 -0700, Adam Parkin wrote:
>
>> Andrew Resch wrote:
>>
>>>> Paul Nienaber wrote:
>>>>
>>>>> Do it this way:
>>>>>
>>>>> foo = malloc(n * sizeof(*foo));
>>>>>
>> >>
>>
>
> If you are going to be doing stuff like this in C you should maybe have
> a look at glib. The lower level library used with gtk. It has some
> very nice routines for C programmers even if they aren't using gtk.
>
>
More information about the Discuss
mailing list