Your Ad Here
0

What is a null pointer?

Posted by The Blogger on 9:01 AM in ,
Answer:

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.

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.

tags: c interview questions and answers, c interview question What is a null pointer, What is a null pointer, null pointer, null, pointer

0 Comments

Post a Comment

Your Ad Here

Copyright © 2009 Interview Questions and Answers