121k views
3 votes
In C++ 11, the ________ key word was introduced to represent the address 0.

A) nullptr
B) NULL
C) weak_ptr
D) All of these
E) None of these

User Guinevere
by
7.8k points

1 Answer

4 votes

Final answer:

In C++ 11, 'nullptr' was introduced as a keyword to represent the address 0, providing a more type-safe option for indicating null pointers.

Step-by-step explanation:

In C++ 11, the keyword introduced to represent the address 0 is nullptr. Option (A) is the correct answer. Previously, the constant NULL was used in place of 0 to indicate a null pointer, but it could lead to type issues and ambiguities in overloading functions. The introduction of nullptr resolved these problems as it is a literal of nullptr_t type, providing a more type-safe null pointer.

User Tda
by
8.4k points