Null Character

The null character (also null terminator), abbreviated NUL, is a control character with the value zero. It is present in many character sets, including ISO/IEC 646 (or ASCII), the C0 control code, the Universal Character Set (or Unicode), and EBCDIC. It is available in nearly all mainstream programming languages.

The original meaning of this character was like NOP—when sent to a printer or a terminal, it does nothing (some terminals, however, incorrectly display it as space). 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. On punched tape, the character is represented with no holes at all, so a new unpunched tape is initially filled with null characters, and often text could be "inserted" at a reserved space of null characters by punching the new characters into the tape over the nulls.

Today the character has much more significance in C and its derivatives and in many data formats, where it serves as a reserved character used to signify the end of a string, often called a null-terminated string or "ASCIIZ" string. This allows the string to be any length with only the overhead of one byte; the alternative of storing a count requires either a string length limit of 255 or an overhead of more than one byte (there are other advantages/disadvantages described under null-terminated string).

Read more about Null CharacterRepresentation

Other articles related to "null character, character, null, characters":

Null Character - Representation
... The null character is often represented as the escape sequence in source code string literals or character constants ... A null character can be placed in a URL with %00, which (in case of unchecked user input) creates a vulnerability known as null byte injection and can lead to security exploits ... In caret notation the null character is ^@ ...
Burrows–Wheeler Transform - Sample Implementation
... Using the null character as the end of file marker, and using s + s to construct the ith rotation of s, the forward transform takes the last character of each of the sorted rows def bwt(s) """Apply ... table is built, it returns the row that ends with null, minus the null ... row (ending in "") return s.rstrip("") # Get rid of trailing null character Here is another, more efficient method for the inverse transform ...
Memset - Definitions
... A string is a contiguous sequence of characters terminated by and including the first null character (written '' and corresponding to the ASCII character NUL) ... It is important to remember that a string ends at the first null character ... An array or string literal that contains a null character before the last byte therefore contains a string, or possibly several strings, but is not itself a string ...

Famous quotes containing the words character and/or null:

    Progressive art can assist people to learn not only about the objective forces at work in the society in which they live, but also about the intensely social character of their interior lives. Ultimately, it can propel people toward social emancipation.
    Angela Davis (b. 1944)

    A strong person makes the law and custom null before his own will.
    Ralph Waldo Emerson (1803–1882)