NULL v. zero
Posted Jul 16, 2004 19:40 UTC (Fri) by
Ross (subscriber, #4065)
In reply to:
NULL v. zero by ikm
Parent article:
NULL v. zero
I disagree that the use of 0 for everything means that C++ is stongly typed.
It seems backwards to me. A srongly typed language should be able to tell
the type of a constant without looking at the lhs of an assignment or the
parameter type in a function call. I don't believe you that C++ magically
knows which one... I think it evaluates it as an int, and then converts to
a pointer on assignment. Where this gets really ugly is with overloaded
functions and operators... if there is an int version and say, an int *
version, which one do you mean to call with a naked 0?
(
Log in to post comments)