Unassigned pointers are dangerous.
Since pointers let us work directly with computer's memory, if we try to (by mistake)
write to a protected location in memory we could get a access violation 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 dynamic array or a long string as a nil pointer.
30.12.2005, 12:42 Uhr
, 14 mal gelesen