Practice mode C++

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.

Report a problem

Answer checked How we write and check questions

Tip: press A, B, C or D to answer, and N for the next question.

Advertisement

Have a question about this answer?

Your email address will not be published. Required fields are marked *

Links and website addresses are not allowed in comments.