Why should we use nullptr instead of NULL or 0?
Show answer and explanation
nullptr has type std::nullptr_t and converts only to pointer-like targets, so it avoids the integer overload ambiguities of 0 and implementation-defined macro forms of NULL. It communicates a null pointer directly.
nullptr has type std::nullptr_t and converts only to pointer-like targets, so it avoids the integer overload ambiguities of 0 and implementation-defined macro forms of NULL. It communicates a null pointer directly.
Connect the conclusion directly to the type, lifetime, ownership, overload-resolution rule, or library contract present in the question. State implementation dependence or a violated precondition explicitly instead of merely guessing output.