Statement A pointer variable does not automatically allocate any memory. A null pointer is a pointer that does not point to anything. It can be assigned to a pointer to indicate that the pointer does not point to any position. The consequences of performing an indirect access operation on a null pointer vary depending on the compiler, and two common consequences are a value that returns zero in memory location and a terminating program. I declare a pointer and assign a value of NULL to see the definition of NULL in VS2013, as follows:
/**/#ifndef null#ifdef __cplusplus#define NULL 0#else / * __cplusplus */#define NULL ((void *) 0)#endif/ * __cplusplus */#endif /* NULL */
It contains some precompiled directives. If NULL is not defined in the preceding code, I define NULL in C + + with a value of 0, otherwise ((void *) 0); You cannot dereference a null pointer at the same time.
Definition of NULL in C and C + + languages