what is the difference between NULL & NUL keywords in C?

Answers were Sorted based on User's Feedback



what is the difference between NULL & NUL keywords in C?..

Answer / shriku322

NULL is a macro defined in 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 ''.

Is This Answer Correct ?    19 Yes 3 No

what is the difference between NULL & NUL keywords in C?..

Answer / abhijit

NULL is a macro defined in <stddef.h> for the null pointer.
<br>NUL is the name of the first character in the ASCII
character set. It corresponds to a zero value. There?s no
<br>standard macro NUL in C, but some people like to define
it. <br>The digit 0 corresponds to a value of 80, decimal.
Don?t confuse the digit 0 with the value of ?? (NUL)!
<br>NULL can be defined as ((void*)0), NUL as ??. <br>

? NewInterviewQuestions.com

Is This Answer Correct ?    17 Yes 5 No

what is the difference between NULL & NUL keywords in C?..

Answer / bryan olson

Neither NULL nor NUL is a keyword in C.
[International Standard ISO/IEC 9899:1999, Programming
Languages -- C, Section 6.4.1 Keywords]

That said, Abhijit did a good job explaining them.

Is This Answer Correct ?    6 Yes 9 No

Post New Answer

More C Interview Questions

what is bitwise operator?

1 Answers   IBM,


Explain the term printf() and scanf() used in c language?

0 Answers  


What is the stack in c?

0 Answers  


Is c pass by value or reference?

0 Answers  


The performance of an operation in several steps with each step using the output of the preceding step a) recursion b) search c) call by value d) call by reference

0 Answers  






Write a code to remove duplicates in a string.

0 Answers   Expedia,


How to use c/c++ code in JAVA

10 Answers   CDAC, IBM, Satyam, Scope International,


Why can arithmetic operations not be performed on void pointers?

0 Answers  


what will be the output of" printf("%d%d",scanf("%d% d",&a&b));"

4 Answers  


biggest of two no's with out using if condition statement

5 Answers  


How do you list a file’s date and time?

0 Answers  


please give me some tips for the placement in the TCS.

0 Answers   TCS,


Categories