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.[1] 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[2], while Visual Basic usesNothing. Fortran does not consider it a constant, but a property that can be set by theNULLIFYdirective and tested by theASSOCIATEDfunction.
- 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. The expressions "A is null" and "A is not null" are the correct ways to test for null values in SQL, although some SQL implementations may considerA = nullto 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. [3]
- Null device
- A virtual device-like entity that delivers no input when read from, and discards all output when written to. In UNIX systems, it is usually denoted by the special file
/dev/null(also referred to as the black hole or bit bucket). In DOS and Windows, it refers to theNULdevice. On AmigaOS 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.
- 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
'\0'). [4]
- 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 string ends with a "Zero", or null character[5].
- When electromechanical teleprinters were used as computer output devices, one or more null characters were sent at the end of each printed line to allow time for the mechanism to return to the first printing position on the next line.
- Null variant
- Some programming languages (such as LISP; Ruby; and Pascal, Delphi, and other languages based on Pascal) use
nilfor the null variant, which can sometimes lead to confusing errors ifnullis accidentally used instead ofnil.
- Null script / null subroutine
- A command script or program subroutine which does nothing but return a constant value. Also known as a stub function or "stubroutine", which are used during program development, where the functional implementation of routines is delayed while other routines are developed. This is also one of the techniques used by the software pirating community to bypass callbacks and license-checking code: the target program is disassembled and the appropriate code is substituted for a null subroutine that just returns the value expected by the caller.
- Null Account
- On certain forums and other internet sites, user database corruption might cause user accounts to suddenly show up as "null" and have all their settings reset. Generally this will remove the user's ability to add new content to the site.
References
- ^ Brian W. Kernighan, Dennis M. Ritchie, The C Programming Language, Second Edition, Prentice Hall New Jersey, ISBN 0-13-110362-8, p. 102
- ^ Elliot B. Koffman, Pascal 3rd Edition, Addison Wesley, Reading MA, ISBN 0-201-11834-3, pp. 678-679
- ^ Kernighan and Ritchie, C, p. 38
- ^ Kernighan and Ritchie, C, p. 38
- ^ Kernighan and Ritchie, C, p. 30
No comments have been added.





