- Null (computer programming)
Null has several meanings in
computer programming .;Null pointer or null reference
* Null is a specialpointer value (or other kind of object reference) used to signify that a pointer intentionally does not point to (or refer to) an object. Such a pointer is called a null pointer. [Brian W. Kernighan ,Dennis M. Ritchie , "The C Programming Language ", Second Edition, Prentice Hall New Jersey, ISBN 0-13-110362-8, p. 102] Many implementations use a value of 0 (all bits zero) to represent the null pointer, as this is at the bottom of the address space of mostCPU s (although some architectures use a signed address space and use the most negative value). Manyoperating system s generate an exception when an attempt is made to access this memory address. Some languages use other nomenclature for such a pointer, e.g., Pascal, Ruby and Lua usenil
[Elliot B. Koffman , "Pascal 3rd Edition", Addison Wesley, Reading MA, ISBN 0-201-11834-3, pp. 678-679] , whileVisual Basic usesNothing
.Fortran does not consider it a constant, but a property that can be set by theNULLIFY
directive and tested by theASSOCIATED
function.;Null value
* In many disciplines, the concept ofnull allows a three-valued logic, with null indicating "no value" or an "unknown value". TheSQL database query language uses Null in this way, as doVisual Basic and its derivatives. In this model, an expression that depends on the value of a Null operand will evaluate toNull
(VB) or "unknown
" (SQL). So, for any A, the expressions "A = Null
" and "A <> Null
" are neither true nor false. However, the boolean operation "A and False
" produces false, and similarly "A or True
" is true, even when A is Null, because these expressions do not depend on the value of A. (Some SQL implementations may considerA = Null
to be "true" if A isNull
; seeNull (SQL) ).;Null string
* A null string, also known as anempty string , is a string of zero length. [ Kernighan and Ritchie, "C", p. 38 ];Null device
* In UNIX systems,:/dev/null (also referred to as theblack hole orbit bucket ) is aspecial file that delivers no input when read from and discards all output when written to. TheNUL
device has similar functionality in DOS and Windows. OnAmigaOS it is known as theNIL:
device.* In Windows XP, null device is a file in system32/drivers, named Null.sys, the size is 2944 bytes. It can be seen in device manager, non-plug-and-play group.
;
Null character
* In the C0 control code set defined in the ISO 646,ASCII , andUnicode character set standards, code value 0 is thenull character (NUL). Mostprogramming languages provide syntax for representing this character as a literal value (e.g., Pascal uses chr(0) or #0, C and its many derivatives use'
Wikimedia Foundation. 2010.