+ 3
What is the use of null pointer..?
Clarify in a simple way.
3 odpowiedzi
+ 13
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.
A nil pointer is a false value. For example, 1 > 2 is a nil statement.
In the programming language C, NULL is an available command that can be used, where nil is an available command used in the Pascal programming language.
SOURCE:
https://www.computerhope.com/jargon/n/nullpoin.htm
+ 6
When you have pointers to stuff, you need a way to tell that your pointer isn't currently pointing at something. nullptr is that way. By changing your pointer to nullptr, you inform your code that it isn't currently valid. While nullptr is normally 0, it isn't a guarentee so always use the symbol.