What is a null pointer?

There are times when it’s necessary to have a pointer that doesn’t point to anything. The macro NULL, defined in <stddef.h>, 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.  The null pointer is used in three ways: 1) To stop indirection in a recursive data structure 2) As an error value 3) As a sentinel value  

Showing Answers 1 - 1 of 1 Answers

supriya ahire

  • Mar 22nd, 2006
 

hi,

   Null pointer:   When referring to computer memory, a null pointer is a command used to direct a software program or operating system to an empty location in the computer memory. Commonly, the null pointer is used to denote the end of a memory search or processing event. In computer programming, a null pointer is a pointer that does not point to any object or function. 

    In the programming language c, NULL is an available command that can be used.

Regards,

Supriya Ahire.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions