A string is a sequence of characters, as a literal constant or variable. A variable may be fixed or dynamic. A string is considered a data type which is implemented as an array data structure of bytes that stores a sequence of elements using character encoding. 
A variable declared to be a string may either cause storage in memory to be statically or dynamically allocated. When a string appears literally in the source code, it is known as a string literal or an anonymous string.
Most data is more complex than just one character, integer, etc. An array is a sequenced collection of elements of the same data type with a single identifier name. A one-dimensional array(list) lists elements vertically. Strings are viewed as a one-dimensional array that is displayed horizontally.
In the “C” programming language, all strings were handled as an array of characters that ended in an ASCII null character (the value 0 or the first character in the ASCII character code set). This approach required programmers to manually process string length and manage string storage. Buffer overflows were common. A buffer overflow, or buffer overrun, is an anomaly where a program, while writing data to a buffer, overruns the buffer’s boundary and overwrites adjacent memory locations.
Most current programming languages implement strings as a data type or class where strings are stored as a length controlled array. String length and storage are handled by the compiler or interpreter, reducing program errors.
Key Terms edit
- A sequenced collection of elements of the same data type with a single identifier name.
- buffer overflow
- An anomaly where a program overruns a memory storage location and overwrites adjacent memory locations.
- Combining two strings into one string.
- An array of single digits or letters that is typically used to display to the user or is the user's input.
- string class
- A complex data item that uses object oriented programming.
- empty string
- It is a unique string of length zero