Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why are strings called "strings"? [duplicate]

Tags:

string

history

Possible Duplicate:
The History Behind the Definition of a 'String'

About the only thing every programming language I've seen is able to agree upon is that a variable that refers to a block of text is called a "string." Why? Where does the name come from, and how did it become idiomatic across programming in general?

like image 776
Mason Wheeler Avatar asked Dec 09 '10 18:12

Mason Wheeler


People also ask

Why are strings called strings in programming?

The text is a linearly ordered string of bits representing the rest of the information required in the loading and listing processes. In fact, it was through ALGOL in April of 1960 that string seems to have taken its modern-day shorthand form “string” (up until then people said string of [something]).

What does string mean in coding?

Most programming languages have a data type called a string, which is used for data values that are made up of ordered sequences of characters, such as "hello world". A string can contain any sequence of characters, visible or invisible, and characters may be repeated.

What is this string?

A string is a data type used in programming, such as an integer and floating point unit, but is used to represent text rather than numbers. It is comprised of a set of characters that can also contain spaces and numbers. For example, the word "hamburger" and the phrase "I ate 3 hamburgers" are both strings.

What is not a string?

A string is any sequence of characters — not just numbers, but letters and punctuation and all of Unicode. Something that isn't a string is... not that. :) (There are lots of things that aren't strings! String isn't special.) For example, 2 is an int .


1 Answers

Great question! This might be somewhat helpful:

Strings are called "strings" because they are made up of a sequence, or string, of characters.

Source: http://www.vias.org/cppcourse/chap07_03.html

like image 57
samxli Avatar answered Oct 19 '22 11:10

samxli