Jump to content

String (computer science)

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Colin dellow (talk | contribs) at 08:19, 27 July 2001 (First addition of string to encyclopedia). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)

A string has special connotations in the world of computing. It is literally a group of letters "strung" together. The most common string is the "null-terminated" (also known as nil-terminated, or 0-terminated) string. It receives this name based on the way it stores data.

For instance, a program may want to receive input of variable length. It requests 10 spaces from the computer into which to store characters. It receives the data to store, and appends a 0 after the data to signify the end of the string.

x x x x x x x x x x x F R A N K 0 k f f w y x x x x x x x x x x x

The above example is how "FRANK" would look in a 10 byte null-terminated string. Characters after the 0 are ignored by the computer.