3 ms·
I consider null to properly mean 'a value outside some value domain', and nil to mean 'zero value in some value domain', and both these values are useful, and c
by riazrizvi 7y ago
I consider null to properly mean 'a value outside some value domain', and nil to mean 'zero value in some value domain', and both these values are useful, and can be assigned to variables of that value domain. So C/C++'s definition of NULL pointers is a historical transgression that has now stuck, as far as I am concerned.
Examples:
p=null-pointer should mean invalid adress, p=nil-pointer should mean zero offset/address.
l=nil-list should be empty list, l=null-list is invalid list. So null-list could also be called undefined-list.
c=null-character is correct as a character, and works well as a terminator.
s=null-string undefined string, s=nil-string empty string "".