According to C++ primer, <cstdlib> header defines NULL. cpluspplus says it is defined in <cstddef>.
Ultimately, if the right header is not included, I thought NULL can’t be referenced.
From what i can see, however it can be referenced and produce programs and that compile and run without warnings or errors, after including only <iostream>
Please help me understand this.
C++03 section 18.1.2 says that NULL is defined in cstddef.
On some implementations, iostream may include cstddef, so including iostream would also give you NULL.