Programming Style Question

Does anyone still use null. And what is your purpose for doing so. I used to use null (for initializing ptrs) but the only reason I see for doing so is to make it clear that the data being initialized is a pointer.
DeXecipher wrote:
to make it clear that the data being initialized is a pointer

?!?! If anything, nullptr at least states clearly that it's a pointer(the "ptr" sufix). So how can using NULL be more clear??
its easy to see when debugging if say for example:

int a = 0;
//than
int* a = NULL;//here the bold characters stand out as NULL is a constant

^not everyone uses nullptr, this is new to me.
Last edited on
C programmers use NULL.
C++ programmers use 0, NULL and nullptr.

nullptr is part of C++11, the latest C++ Standard.
People typically use NULL specifically for pointers, which is what I use it for. So, as far as I go anyway, yes, someone still uses it. I can't imagine it's not still commonly used, really.

@viliml: I think he means using NULL as opposed to using 0. :P
Last edited on
Topic archived. No new replies allowed.