What is the type of the nullptr literal in C++?
Correct answer B. std::nullptr_t
Explanation
nullptr is a prvalue of type std::nullptr_t, declared in . It converts implicitly to any pointer or pointer-to-member type but not to integer types, which makes overload resolution with pointers safe. NULL, in contrast, is a macro that is often just 0 or 0L and so behaves as an integer in overload resolution.
Answer checked How we write and check questions
Discussion