看到c++ prime 5中page 48 中介绍了初始化指针的介绍
int *p1 = nullptr;
int *p2 = 0;
int *p3 = NULL;
项目开发中一般都是把指针赋值NULL,因为0是给int类型初始化的,那么nullpter是什么鬼,
stack flow的解答
nullptr
is always a pointer type. 0
(aka. C's NULL bridged over into C++) could cause ambiguity in overloaded function resolution, among other things:
If you have to name the null pointer, call it nullptr; that's what it's called in C++11. Then, "nullptr" will be a keyword.