This is the mail archive of the egcs@egcs.cygnus.com mailing list for the EGCS project. See the EGCS home page for more information.


[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index] [Subject Index] [Author Index] [Thread Index]

Re: C++ definition of NULL



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