There is no standardized NUL
macro, at least not in C.
Also, NULL
has the advantage over a plain 0
literal that it signals to the reader that "hey, we're dealing with a pointer" which might be considered an advantage.
In C++, the idiom was for a long while to just write 0
, but then they seem to have reversed that and introduced a new literal, nullptr
for some reason(s).
In C, I recommend writing NULL
for pointers and '\0'
for characters.