开发者

Why are strings called "strings"? [duplicate]

开发者 https://www.devze.com 2023-01-29 13:16 出处:网络
This question already has answers here: Closed 12 years ago. Possible Duplicate: The History Behind the Definition of a \'String\'
This question already has answers here: Closed 12 years ago.

Possible Duplicate:

The History Behind the Definition of a 'String'

About the only thing every programming language I've seen is able to a开发者_Go百科gree 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?


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


Very interesting,

The very definition of a string (according to Princeton at least) is:

a linear sequence of symbols

So, since the String datatype is a sequence of characters/symbols, it rather fits the definition.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号