C++ definition of NULL
Alexandre Oliva
oliva@dcc.unicamp.br
Wed Mar 31 23:46:00 GMT 1999
On Mar 3, 1999, "Doug Semler" <doug@seaspace.com> wrote:
> So the way I read the standard, the type of a null pointer constant is
> a pointer type of pointer to destination's cv-qualified type.
> eg:
> int *a = NULL ; // NULL has type int *
> int a = NULL; // Error: cannot implicitly convert pointer type to int
> Right?????
Nope. Since NULL is an integral expression, it can be converted to
int, so there's no error above.
--
Alexandre Oliva http://www.dcc.unicamp.br/~oliva aoliva@{acm.org,computer.org}
oliva@{dcc.unicamp.br,gnu.org,egcs.cygnus.com,samba.org}
Instituto de Computação, Universidade Estadual de Campinas, SP, Brasil
More information about the Gcc
mailing list