Question:
What is the difference between NULL and NUL?
Answer:
NULL is a macro defined in <stddef.h> for the null pointer.
NUL is the name of the first character in the ASCII character set. It corresponds to a zero value. There’s no standard macro NUL in C, but some people like to define it.
The digit 0 corresponds to a value of 80, decimal. Don’t confuse the digit 0 with the value of ‘’ (NUL)! NULL can be defined as ((void*)0), NUL as ‘’. Source: CoolInterview.com
basically NULL points the predefined value zero to the compiler !! and NUL is the name of 1st character in the ASCII character set!! Source: CoolInterview.com
Answered by: arpit garg | Date: 4/6/2010
| Contact arpit garg
sizeof(NUL)=1 byte sizeof(NULL)=4 byte Source: CoolInterview.com
Answered by: zakiya | Date: 5/25/2010
| Contact zakiya
NULL is a macro defined in <stddef.h> for the null pointer.
NUL is a user define variable Source: CoolInterview.com
Answered by: baba | Date: 6/24/2010
| Contact baba
basically NULL is predefined variable we can't defined value of NULL and NUL is defined by user its values changed by user time to time according its requirement. Source: CoolInterview.com
Answered by: vaishali jain | Date: 7/27/2010
| Contact vaishali jain
wew Source: CoolInterview.com
Answered by: tty | Date: 8/11/2010
| Contact tty
NULL = a macro defined in <stddef.h> for the null pointer.
NUL = a user define variable Source: CoolInterview.com
Answered by: Rahul hatke | Date: 9/7/2010
| Contact Rahul hatke
If you have the better answer, then send it to us. We will display your answer after the approval.
Rules to Post Answers in CoolInterview.com:-
- There should not be any Spelling Mistakes.
- There should not be any Gramatical Errors.
- Answers must not contain any bad words.
- Answers should not be the repeat of same answer, already approved.
- Answer should be complete in itself.
|