Sujet : Re: question about nullptr
De : tr.17687 (at) *nospam* z991.linuxsc.com (Tim Rentsch)
Groupes : comp.lang.cDate : 10. Jul 2024, 15:51:58
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <86msmp8fld.fsf@linuxsc.com>
References : 1 2 3 4 5 6 7 8 9 10 11 12
User-Agent : Gnus/5.11 (Gnus v5.11) Emacs/22.4 (gnu/linux)
Keith Thompson <Keith.S.Thompson+
u@gmail.com> writes:
Tim Rentsch <tr.17687@z991.linuxsc.com> writes:
[...]
>
This posting has inspired me to try using (long)0.0
whenever a null pointer constant is needed. As for
example
>
(void*){ (long)0.0 }
>
as an argument to a variadic function where a pointer
is expected.
>
But surely ((void*)('/'/'/'-'/'/'/')) is more elegant.
Surely not. Furthermore the form I showed has a point,
whereas this example is roughly the equivalent of a
first grade knock-knock joke.