Null-terminated string: Difference between revisions

Content deleted Content added
Move ref to where it should be
none of this is helpful to understanding NTS
Tag: section blanking
Line 12:
 
[[FreeBSD]] developer [[Poul-Henning Kamp]], writing in ''[[ACM Queue]]'', would later refer to the victory of null-terminated strings over a 2-byte (not one-byte) length as "the most expensive one-byte mistake" ever.<ref>{{citation |last=Kamp |first=Poul-Henning |date=25 July 2011 |title=The Most Expensive One-byte Mistake |journal=ACM Queue |volume=9 |number=7 |issn=1542-7730 |accessdate=2 August 2011 |url=http://queue.acm.org/detail.cfm?id=2010365 }}</ref>
 
== Implementations ==
{{expand section|date=November 2011}}
{{Main|C string handling#Functions}}
[[C (programming language)|C programming language]] supports null-terminated strings as the primary string type.<ref>{{cite web |title=The Development of the C Language |url=http://cm.bell-labs.com/cm/cs/who/dmr/chist.html |accessdate=9 November 2011 |first=Dennis |last=Richie |year=2003 }}</ref> There are many [[C string handling|functions for string handling]] in the [[C standard library]]. Operations supported include:
* Determining the length of a string
* Copying one string to another
* Appending (concatenating) one string to another
* Finding the first (or last) occurrence of a character within a string
* Finding within a string the first occurrence of a character in (or not in) a given set
* Finding the first occurrence of a substring within a string
* Comparing two strings lexicographically
* Splitting a string into multiple substrings
* Formatting numeric or string values into a printable output string
* Parsing a printable string into numeric values
* Converting between [[SBCS|single-byte]] and [[wide character]] string encodings
* Converting single-byte or wide character strings to and from [[variable-width encoding|multi-byte]] character strings
 
== Limitations ==