Null pointer
what is 'null pointer' exactly in 'C' ...?
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Suraj BinorkarPosted Aug 6, 2016, 5:25 AM
VulpesPosted Oct 22, 2013, 3:50 PM
In C, you're guaranteed that all variables and functions will always have a non-zero address. You can therefore be certain that a null pointer (i.e. a pointer with the value 0) can never point to a valid entity as I said earlier.
If you have a function which returns a pointer, you can therefore return a null pointer to indicate 'no result' or that some error occurred.
There is a constant NULL defined in the standard library which you can use to indicate a null pointer instead of the integer 0.
Abhishek JaiswalPosted Oct 22, 2013, 2:12 PM
VulpesPosted Oct 22, 2013, 12:15 PM