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





Comments and Discussions

Ad: Are you a blogger? Join our Blogging forum.




Languages: » C » C++ » C++ STL » Java » Data Structure » C#.Net » Android » Kotlin » SQL
Web Technologies: » PHP » Python » JavaScript » CSS » Ajax » Node.js » Web programming/HTML
Solved programs: » C » C++ » DS » Java » C#
Aptitude que. & ans.: » C » C++ » Java » DBMS
Interview que. & ans.: » C » Embedded C » Java » SEO » HR
CS Subjects: » CS Basics » O.S. » Networks » DBMS » Embedded Systems » Cloud Computing » Machine learning » CS Organizations » Linux » DOS
More: » Articles » Puzzles » News/Updates

© https://www.includehelp.com some rights reserved.