String (computer science): Difference between revisions

Content deleted Content added
Line 196:
While character strings are very common uses of strings, a string in computer science may refer generically to any sequence of homogeneously typed data. A [[bit string]] or [[byte string]], for example, may be used to represent non-textual [[binary data]] retrieved from a communications medium. This data may or may not be represented by a string-specific datatype, depending on the needs of the application, the desire of the programmer, and the capabilities of the programming language being used. If the programming language's string implementation is not [[8-bit clean]], data corruption may ensue.
 
C programmers draw a sharp distinction between a "string", aka a "string of characters", which by definition is always null terminated, vs. a "bytearray string"of or "pseudo stringcharacters" which may be stored in the same array but is often not null terminated.
Using [[C string handling]] functions on such aan "bytearray string"of characters often seems to work, but later leads to [[#Security concerns|security problems]].<ref>
[https://www.sudo.ws/todd/papers/strlcpy.html "strlcpy and strlcat - consistent, safe, string copy and concatenation."] {{webarchive|url=https://web.archive.org/web/20160313163321/https://www.sudo.ws/todd/papers/strlcpy.html |date=2016-03-13 }}
</ref><ref>