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

Given an array A[n+m] of n+m numbers, where A[1] ... A[n] is sorted and A[n+1] ... A[n+m] is sorted. Design a linear time algorithm to obtain A[1...n+m] sorted using only O(1) extra space. Time Complexity of your algorithm should be O(n) and Space Complexity O(1).

0 Answers  


What is string concatenation in c?

0 Answers  


How do you do dynamic memory allocation in C applications?

0 Answers  


What is the method to save data in stack data structure type?

0 Answers  


what are the stoge class in C and tel the scope and life time of it?

2 Answers   Tech Mahindra,






what is an array

5 Answers  


What is a scope resolution operator in c?

0 Answers  


can we implement multi-threads in c.

0 Answers  


What is the difference between getch() and getche()?

1 Answers   NSPL,


What kind of structure is a house?

0 Answers  


Why does everyone say not to use gets?

0 Answers  


How to add two numbers without using semicolon at runtime

2 Answers  


Categories