[std.c.stdlib] (malloc(something) is null) or (malloc(something) == 0)?

Adam D. Ruppe via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Tue May 20 07:07:11 PDT 2014


On Tuesday, 20 May 2014 at 14:03:17 UTC, Alexandr Druzhinin wrote:
> if(data ?) // is null vs == 0

Both would work and do the same thing, but I prefer "is null" 
because that is most consistent with other D code (where there 
might be a difference between the two).


More information about the Digitalmars-d-learn mailing list