What is a null pointer? Ans. There are times when it's necessary to have a pointer that doesn't point to anything. The macro NULL, defined in , has a value that's guaranteed to be different from any valid pointer. NULL is a literal zero, possibly cast to void* or char*. Some people, notably C programmers, prefer to use 0 rather than NULL. You can't use an integer when a pointer is required. The exception is that a literal zero value can be used as the null pointer. (It doesn't have to be a literal zero, but that's the only useful case. Any expression that can be evaluated at compile time, and that is zero, will do. It's not good enough to have an integer variable that might be zero at runtime.) - Study24x7
Social learning Network
04 Apr 2023 11:28 AM study24x7 study24x7

What is a null pointer? Ans. There are times when it's necessary to have a pointer that doesn't point to anything. The macro NULL, defined in , has a value that's guaranteed to be different from any valid pointer. NULL is a literal zero, possibly cast to void* or char*...

See more

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