Home » C programming language

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).

Was this page helpful? Please share with your friends...

Are you a blogger? Join our Blogging forum.

Comments and Discussions

© https://www.includehelp.com (2015-2018), Some rights reserved.

close Like other websites, this site uses cookies to deliver relevant ads based on your interest, by using our website, you acknowledge that you have read our privacy policy.