Null-terminated byte strings
From cppreference.com
A null-terminated byte string (NTBS) is a sequence of nonzero bytes followed by a byte with value zero (the terminating null character). Each byte in a byte string encodes one character of some character set. For example, the character array {'\x63', '\x61', '\x74', '\0'} is an NTBS holding the string "cat" in ASCII encoding.
Contents |
[edit] Functions
Character classification | |
| Defined in header
<cctype> | |
| checks if a character is alphanumeric (function) | |
| checks if a character is alphabetic (function) | |
| checks if a character is lowercase (function) | |
| checks if a character is an uppercase character (function) | |
| checks if a character is a digit (function) | |
| checks if a character is a hexadecimal character (function) | |
| checks if a character is a control character (function) | |
| checks if a character is a graphical character (function) | |
| checks if a character is a space character (function) | |
| (C++11) |
checks if a character is a blank character (function) |
| checks if a character is a printing character (function) | |
| checks if a character is a punctuation character (function) | |
Character manipulation | |
| converts a character to lowercase (function) | |
| converts a character to uppercase (function) | |
| ASCII values | characters | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| decimal | hexadecimal | octal | |||||||||||||
| 0β8 | \x0β\x8
|
\0β\10
|
control codes (NUL, etc.)
|
β 0
|
0
|
0
|
0
|
0
|
0
|
0
|
0
|
0
|
0
|
0
|
0
|
| 9 | \x9
|
\11
|
tab (\t)
|
β 0
|
0
|
β 0
|
β 0
|
0
|
0
|
0
|
0
|
0
|
0
|
0
|
0
|
| 10β13 | \xAβ\xD
|
\12β\15
|
whitespaces (\n, \v, \f, \r)
|
β 0
|
0
|
β 0
|
0
|
0
|
0
|
0
|
0
|
0
|
0
|
0
|
0
|
| 14β31 | \xEβ\x1F
|
\16β\37
|
control codes | β 0
|
0
|
0
|
0
|
0
|
0
|
0
|
0
|
0
|
0
|
0
|
0
|
| 32 | \x20
|
\40
|
space | 0
|
β 0
|
β 0
|
β 0
|
0
|
0
|
0
|
0
|
0
|
0
|
0
|
0
|
| 33β47 | \x21β\x2F
|
\41β\57
|
!"#$%&'()*+,-./
|
0
|
β 0
|
0
|
0
|
β 0
|
β 0
|
0
|
0
|
0
|
0
|
0
|
0
|
| 48β57 | \x30β\x39
|
\60β\71
|
0123456789
|
0
|
β 0
|
0
|
0
|
β 0
|
0
|
β 0
|
0
|
0
|
0
|
β 0
|
β 0
|
| 58β64 | \x3Aβ\x40
|
\72β\100
|
:;<=>?@
|
0
|
β 0
|
0
|
0
|
β 0
|
β 0
|
0
|
0
|
0
|
0
|
0
|
0
|
| 65β70 | \x41β\x46
|
\101β\106
|
ABCDEF
|
0
|
β 0
|
0
|
0
|
β 0
|
0
|
β 0
|
β 0
|
β 0
|
0
|
0
|
β 0
|
| 71β90 | \x47β\x5A
|
\107β\132
|
GHIJKLMNOPQRSTUVWXYZ
|
0
|
β 0
|
0
|
0
|
β 0
|
0
|
β 0
|
β 0
|
β 0
|
0
|
0
|
0
|
| 91β96 | \x5Bβ\x60
|
\133β\140
|
[\]^_`
|
0
|
β 0
|
0
|
0
|
β 0
|
β 0
|
0
|
0
|
0
|
0
|
0
|
0
|
| 97β102 | \x61β\x66
|
\141β\146
|
abcdef
|
0
|
β 0
|
0
|
0
|
β 0
|
0
|
β 0
|
β 0
|
0
|
β 0
|
0
|
β 0
|
| 103β122 | \x67β\x7A
|
\147β\172
|
ghijklmnopqrstuvwxyz
|
0
|
β 0
|
0
|
0
|
β 0
|
0
|
β 0
|
β 0
|
0
|
β 0
|
0
|
0
|
| 123β126 | \x7Bβ\x7E
|
\172β\176
|
{|}~
|
0
|
β 0
|
0
|
0
|
β 0
|
β 0
|
0
|
0
|
0
|
0
|
0
|
0
|
| 127 | \x7F
|
\177
|
backspace character (DEL)
|
β 0
|
0
|
0
|
0
|
0
|
0
|
0
|
0
|
0
|
0
|
0
|
0
|
Conversions to numeric formats | |
| Defined in header
<cstdlib> | |
| converts a byte string to a floating point value (function) | |
| (C++11) |
converts a byte string to an integer value (function) |
| (C++11) |
converts a byte string to an integer value (function) |
| (C++11) |
converts a byte string to an unsigned integer value (function) |
| converts a byte string to a floating point value (function) | |
| Defined in header
<cinttypes> | |
| (C++11)(C++11) |
converts a byte string to std::intmax_t or std::uintmax_t (function) |
String manipulation | |
| Defined in header
<cstring> | |
| copies one string to another (function) | |
| copies a certain amount of characters from one string to another (function) | |
| concatenates two strings (function) | |
| concatenates a certain amount of characters of two strings (function) | |
| transform a string so that strcmp would produce the same result as strcoll (function) | |
String examination | |
| Defined in header
<cstring> | |
| returns the length of a given string (function) | |
| compares two strings (function) | |
| compares a certain number of characters from two strings (function) | |
| compares two strings in accordance to the current locale (function) | |
| finds the first occurrence of a character (function) | |
| finds the last occurrence of a character (function) | |
| returns the length of the maximum initial segment that consists of only the characters found in another byte string (function) | |
| returns the length of the maximum initial segment that consists of only the characters not found in another byte string (function) | |
| finds the first location of any character from a set of separators (function) | |
| finds the first occurrence of a substring of characters (function) | |
| finds the next token in a byte string (function) | |
Character array manipulation | |
| Defined in header
<cstring> | |
| searches an array for the first occurrence of a character (function) | |
| compares two buffers (function) | |
| fills a buffer with a character (function) | |
| copies one buffer to another (function) | |
| moves one buffer to another (function) | |
Miscellaneous | |
| Defined in header
<cstring> | |
| returns a text version of a given error code (function) | |
[edit] See also
| C documentation for Null-terminated byte strings
|