if ((tomime_fields.fld_description==cast(char*)0)) throw new Exception("show_part_info: description is NULL");
Checking C return results against NULL
Laeeth Isharc via Digitalmars-d-learn Wed, 31 Dec 2014 03:25:57 -0800
Am I missing a more agreeable way to check the return value of a
C function against NULL. It's fine if it's a char*, but if it
returns a pointer to some kind of struct, one has to go through
and convert each instance of NULL to a cast of the appropriate
return type. Eg cast(funnystruct*)0
- Checking C return results against... Laeeth Isharc via Digitalmars-d-learn
- Re: Checking C return result... Rikki Cattermole via Digitalmars-d-learn
- Re: Checking C return re... Mike Parker via Digitalmars-d-learn
- Re: Checking C retur... Laeeth Isharc via Digitalmars-d-learn