while (p)可以判断p指针非空,等效于while (p != NULL)不论是if (expr)还是while (expr),都是在expr != 0时为真的,空指针NULL本身也就是0,因此从简洁的角度while (p != NULL)可以直接写成while (p)