What is a Null pointer?
Options
Answers
-
Null pointer is a pointer not pointing to any memory. This occurs in two cases.
i. Either a pointer has been just defined without assigning a memory location yet.
ii. After completion of the task where an pointer was used, has been released from the memory location.All above cases are expected one. But sometimes it could be dangerous to use Null pointer without assigning a memory location. Generally most of compilers complain about it. Then you need to rectify the code accordingly.