What is NULL pointer and how it is defined?

C language frequently asked question on string declaration: What is NULL pointer and how it is defined?
Submitted by IncludeHelp, on December 20, 2017

NULL is a preprocessor Macro, which is defined as null pointer constant, it can be defined in several files like stdio.h, stddef.h. The value of NULL is 0 (Zero) or ((void*) 0).

Initializing a variable by NULL is a stylistic convention only, and it turns back into 0 through preprocessor.

It is programmer's choice, whether he/she wants to initialize an object (variable or whatever) with NULL or 0 (both are same).




Comments and Discussions!

Load comments ↻





Copyright © 2024 www.includehelp.com. All rights reserved.