更新时间:2023-01-05 21:44:44
获取未初始化的指针:
int* ptr;//points to any location in memory
采用空指针:
int* ptr = NULL;//normally points to 0x0 (0)
如果取消引用,两者都将导致未定义的行为. NULL
通常定义为0
.
Both would cause undefined behaviour if dereferenced. NULL
is often defined as 0
.