Null pointer in C++

前端 未结 8 465
悲&欢浪女
悲&欢浪女 2021-01-14 20:02

When in C++ I declare a null pointer to be int* p=0, does that mean the zero is some special constant of integer pointer type, or does it mean that p

8条回答
  •  抹茶落季
    2021-01-14 20:32

    The value of the pointer is just 0. It doesn't necessarily mean it points to address 0x0. The NULL macro, is just a 0 constant.

提交回复
热议问题