C Programming - Pointers - Discussion

Discussion Forum : Pointers - General Questions (Q.No. 3)
3.
In which header file is the NULL macro defined?
stdio.h
stddef.h
stdio.h and stddef.h
math.h
Answer: Option
Explanation:
The macro "NULL" is defined in locale.h, stddef.h, stdio.h, stdlib.h, string.h, time.h, and wchar.h.
Discussion:
48 comments Page 1 of 5.

Dipak said:   3 years ago
STDDEF.C is a header file.

Am I right?
(2)

Akshay Kalra said:   6 years ago
NULL is defined as:

#define NULL (void *)0

Rashmi said:   8 years ago
Please explain locale.h header file. What does it contain?

Shanthi said:   8 years ago
Please tell about B].stddef.h.

Omkar Patil said:   8 years ago
It also defined in alloc.h and mem.h.

Varsha said:   10 years ago
NULL Pointer is a pointer which is pointing to nothing. It points the base address of segment.

In case, if you don't have address to be assigned to pointer then you can simply use NULL Pointer which is initialized with NULL value is considered as NULL pointer.

Karthika said:   1 decade ago
I need the purpose of using wchar.h in this program.

Vinod said:   1 decade ago
What is the purpose of using null pointer?

Prasanna said:   1 decade ago
Macro is available in stdlib.h, stddef.h, locale.h. etc.,

We know that NULL represents nothing. But it should have some value. While using NULL in program we may get garbage value. So to avoid that garbage values. NULL macro defines that NULL is "0". So in program if we got any null value that will be taken as zero.

Meera said:   1 decade ago
NULL Macro is simply what is defined as 0 in a macro provided by the library.


Post your comments here:

Your comments will be displayed after verification.