What's the difference between a null pointer and a void pointer?

前端 未结 11 1647
甜味超标
甜味超标 2020-12-02 05:13

Whats the difference between a Null pointer & a Void pointer?

11条回答
  •  广开言路
    2020-12-02 05:46

    They are two different concepts: "void pointer" is a type (void *). "null pointer" is a pointer that has a value of zero (NULL). Example:

    void *pointer = NULL;
    

    That's a NULL void pointer.

提交回复
热议问题