Null Characters

Null Characters

Null Characters: a character with all bits set to zero.

A null character in itself is a set of bits with their value set to zero (remember binary bits can either be assigned a 1 or a 0).

On their own, they are not very useful, so they have been adopted by programmers to be used in strings and in databases as a tool with a few uses.

The first use is in the crafting of strings, which are data types used to represent text, and can be words, phrases, etc. and can include spaces and numbers.

Strings are used in this context as a way to distinguish the beginning and end of a string or parts of a string (i.e. the start, finish and spaces).

If they weren’t used, it would be harder for the computer to decipher. In fact, without null characters, string limits would have to be imposed of 255 characters or extra overhead of more than one byte would need to be included.

Null characters allow the computer to only have to leave one byte of overhead and to have an indefinite number of characters in a string.

Before its use in modern coding, null characters were used in printers as a way to break up the outflow of data from computer into printer, so that at the end of each line the printer had a series of null characters representing no information that gave it time to reset to the correct position to continue printing.

Read more