Q&A
Ask and answer questions to make information more available to wider audiences.
Muhammad Benson @bensonmuhammad   02, May 2023 12:00 AM
NILing pointers
What is NILing pointers?
answers 1
 
Answer 1
Alivia Morrish @morrishalivia   05, May 2023 04:57 PM
NILing pointers: Unassigned pointers are dangerous. Since pointers let us work direclty with computer's memory, if we try to (by mistake) write to a protected location in memory we could get a GPF error. This is the reason why we should always initialize a pointer to a special value of NIL. The reserved word nil is a special constant that can be assigned to any pointer. When nil is assigned to a pointer, the pointer doesn't reference anything. Delphi presents, for example, an empty dynamics array or a long string as a nil pointer.