What is the difference between NULL and NUL? Ans. 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. NULL can be defined as ((void*)0), NUL as '\0'. Both can also be defined simply as 0. If they're defined that way, they can be used interchangeably. That's a bad way to write C code. One is meant to be used as a pointer; the other, as a character. If you write your code so that the difference is obvious, the next person who has to read and change your code will have an easier job. If you write obscurely, the next person might have problems. - Study24x7
Social learning Network
07 Apr 2023 10:28 AM study24x7 study24x7

What is the difference between NULL and NUL? Ans. 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...

See more

study24x7
Write a comment
Related Questions
500+   more Questions to answer
Most Related Articles