(I'm really intersted: why do you actually need the strict difference between 0 and NULL? any important reason?)

definition of NULL in stdlib.h (how it is defined in c++ and c)

Quote:

#ifndef NULL
#ifdef __cplusplus
#define NULL 0 //NULL ist das gleiche wie 0
#else
#define NULL ((void *)0) //0 pointer
#endif
#endif


answer to the same question in an english forum

(http://bytes.com/forum/thread61514.html)
Quote:

In 'C', NULL is defined like this:

#define NULL (void*)0


In C++, NULL is defined like this:

#define NULL 0


If you try and initialise a pointer to a type with a pointer to void, you'll
get errors with a C++ compiler:

int* p = (void*)0; // OK in 'C*, error in C++
int* p = 0; // OK in C++, error in 'C'


C++ specifically forbids the 'C' style definition of NULL. Why? Perhaps
assigning a 'pointer to a type' to the 'C' style NULL could be considered
similar to assigning a 'pointer to a derived type' to a 'pointer to base
type', which would be wrong. Then again, is assigning a 'pointer to a type'
to the value zero is any more correct; besides which 'void' is not the base
type of all types? You could say that it's a bit of shambles (I do). Then
again, C++ isn't a real OO language; it's a baggage of OO extensions to 'C'
which is, essentially, just portable assembler. To do the job properly, you
would need a language that had a common base type for all types and Null
instances of every derived type.




just search the web.. you'll get a lot of answers smile
http://www.google.de/search?rlz=1C1CHMG_deDE291&sourceid=chrome&ie=UTF-8&q=NULL+C%2B%2B

PS: Again: why do you really care about the difference of NULL and 0?

Last edited by TechMuc; 09/19/08 21:49.