Francais | English | Espanõl

Null (computer)

From Wikipedia, the free encyclopedia

Jump to: navigation, search

Null has several meanings in computer programming.

Null pointer/value
  • Null is a special value for a pointer (or other kind of object reference) used to signify that the pointer intentionally does not have a target. Such a pointer is called a null pointer. Many implementations use a binary 0 (all bits zero) as the null value, as most operating systems consider it an error to try to access such a low memory address. Some languages use other nomenclature for such a pointer, e.g., nil, undefined, void reference, etc.
  • In many disciplines, the concept of null allows a three-valued logic, with null indicating "unknown value". The SQL database query language uses Null in this way, as do Visual Basic (termed "Nothing") and its derivatives. In this model, an expression that depends on the value of a Null operand will evaluate to Null (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 consider A = Null to be "true" if A is Null; see Null (SQL)).
Null device
  • In UNIX systems, /dev/null (also referred to as the black hole or bit bucket) is a special file that delivers no input when read and absorbs all output when written. The NUL device has similar functionality in DOS and Windows.
Null character
  • In some programming languages, the null character denotes the end of a character string. Such strings that are encoded with the ASCII character set are sometimes referred to as ASCIIZ or ASCIZ strings - the 'Z' indicating that the terminating 'Zero' or null character is present.
Null variant
  • Some programming languages (such as LISP, Pascal, Delphi, and other languages based on Pascal) use nil for the null variant (which can lead to somewhat confusing errors if null is accidentally used instead of nil). In Ruby, the designation is called nil.cs:NULL

de:Nullwert es:Null fr:Null ko:? it:NULL hu:Null nl:Null ja:ヌル (コンピュータ) pt:Null (programação) ru:???? (?????) fi:Tyhjä (ohjelmointi) sv:Null

Personal tools