Null pointer in C++

前端 未结 8 463
悲&欢浪女
悲&欢浪女 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 pointer points to address 0. On most platforms that is very special, but you should use NULL, because it is not always 0 (but very often).

提交回复
热议问题