Null (computer programming)

Null (computer programming)

Null has several meanings in computer programming.

;Null pointer or null reference
* Null is a special pointer 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 most CPUs (although some architectures use a signed address space and use the most negative value). Many operating systems 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 use nil [Elliot B. Koffman, "Pascal 3rd Edition", Addison Wesley, Reading MA, ISBN 0-201-11834-3, pp. 678-679] , while Visual Basic uses Nothing. Fortran does not consider it a constant, but a property that can be set by the NULLIFY directive and tested by the ASSOCIATED function.

;Null value
* In many disciplines, the concept of null allows a three-valued logic, with null indicating "no value" or an "unknown value". The SQL database query language uses Null in this way, as do Visual Basic 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 string
* A null string, also known as an empty string, is a string of zero length. [ Kernighan and Ritchie, "C", p. 38 ]

;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 from and discards all output when written to. The NUL device has similar functionality in DOS and Windows. On AmigaOS it is known as the NIL: 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, and Unicode character set standards, code value 0 is the null character (NUL). Most programming 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.

Игры ⚽ Поможем сделать НИР

Look at other dictionaries:

  • Comment (computer programming) — For comments in Wikipedia markup, see Help:Wiki markup#Character formatting and WP:COMMENT. An illustration of Java source code with prologue comments indicated in red and inline comments in green. Program code is in blue …   Wikipedia

  • Reflection (computer programming) — Programming paradigms Agent oriented Automata based Component based Flow based Pipelined Concatenative Concurrent computi …   Wikipedia

  • this (computer programming) — In many object oriented programming languages, this (also called self or Me) is a keyword that is used in instance methods to refer to the object on which they are working. C++ and languages which derive in style from it (such as Java, C#, and… …   Wikipedia

  • Programming language — lists Alphabetical Categorical Chronological Generational A programming language is an artificial language designed to communicate instructions to a machine, particularly a computer. Programming languages can be used to create programs that… …   Wikipedia

  • Null — may refer to: Contents 1 In computing 2 In art 3 In mathematics 4 In science 5 People …   Wikipedia

  • Null Object pattern — Null object redirects here. For the concept in category theory, see Initial object. In object oriented computer programming, a Null Object is an object with defined neutral ( null ) behavior. The Null Object design pattern describes the uses of… …   Wikipedia

  • Null-terminated string — In computer programming, a null terminated string is a character string stored as an array containing the characters and terminated with a null character ( , called NUL in ASCII). Alternative names are C string, which refers to the C… …   Wikipedia

  • Null vector — For other uses, see Null (disambiguation). In linear algebra, the null vector or zero vector or empty vector is the vector (0, 0, …, 0) in Euclidean space, all of whose components are zero. It is usually written with an arrow head above or below… …   Wikipedia

  • Comparison of programming languages (object-oriented programming) — Programming language comparisons General comparison Basic syntax Basic instructions Arrays Associative arrays String operations …   Wikipedia

  • Computer chess — 1990s Pressure sensory chess computer with LCD screen Chess+ For the iPad …   Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”