C C++ Java Data Structure Python JavaScript CSS Ajax PL/SQL PHP Puzzles C programs C++ programs Java programs

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

Liked this article? Do share with your friends :)

Are you a blogger? Join our Blogging forum.