Null-terminated wide strings - cppreference.com

##### cppreference.com

##### Search

Create account

##### Namespaces

- Page
- Discussion

##### Variants

##### Views

- View
- Edit
- History

##### Actions

# Null-terminated wide strings

From cppreference.com
< c‎ | string

A null-terminated wide string is a sequence of valid wide characters, ending with a null-character.

### [edit] Functions

##### Character classification
Defined in header `<wctype.h>`
iswalnum (C95) | checks if a wide character is alphanumeric (function) [edit]
iswalpha (C95) | checks if a wide character is alphabetic (function) [edit]
iswlower (C95) | checks if a wide character is an lowercase character (function) [edit]
iswupper (C95) | checks if a wide character is an uppercase character (function) [edit]
iswdigit (C95) | checks if a wide character is a digit (function) [edit]
iswxdigit (C95) | checks if a character is a hexadecimal character (function) [edit]
iswcntrl (C95) | checks if a wide character is a control character (function) [edit]
iswgraph (C95) | checks if a wide character is a graphical character (function) [edit]
iswspace (C95) | checks if a wide character is a space character (function) [edit]
iswblank (C99) | checks if a wide character is a blank character (function) [edit]
iswprint (C95) | checks if a wide character is a printing character (function) [edit]
iswpunct (C95) | checks if a wide character is a punctuation character (function) [edit]
iswctype (C95) | classifies a wide character according to the specified LC_CTYPE category (function) [edit]
wctype (C95) | looks up a character classification category in the current C locale (function) [edit]
##### Character manipulation
Defined in header `<wctype.h>`
towlower (C95) | converts a wide character to lowercase (function) [edit]
towupper (C95) | converts a wide character to uppercase (function) [edit]
towctrans (C95) | performs character mapping according to the specified LC_CTYPE mapping category (function) [edit]
wctrans (C95) | looks up a character mapping category in the current C locale (function) [edit]

ASCII values (hex) | characters | `iscntrl` `iswcntrl` | `isprint` `iswprint` | `isspace` `iswspace` | `isblank` `iswblank` | `isgraph` `iswgraph` | `ispunct` `iswpunct` | `isalnum` `iswalnum` | `isalpha` `iswalpha` | `isupper` `iswupper` | `islower` `iswlower` | `isdigit` `iswdigit` | `isxdigit` `iswxdigit`
--- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---
0 - 8 | `0x00-0x08` | control codes (`NUL`, etc.) | `≠0` | `0` | `0` | `0` | `0` | `0` | `0` | `0` | `0` | `0` | `0` | `0`
9 | `0x09` | tab (`\t`) | `≠0` | `0` | `≠0` | `≠0` | `0` | `0` | `0` | `0` | `0` | `0` | `0` | `0`
10 - 13 | `0x0A-0x0D` | whitespaces (`\n`,`\v`,`\f`,`\r`) | `≠0` | `0` | `≠0` | `0` | `0` | `0` | `0` | `0` | `0` | `0` | `0` | `0`
14 - 31 | `0x0E-0x1F` | control codes | `≠0` | `0` | `0` | `0` | `0` | `0` | `0` | `0` | `0` | `0` | `0` | `0`
32 | `0x20` | space | `0` | `≠0` | `≠0` | `≠0` | `0` | `0` | `0` | `0` | `0` | `0` | `0` | `0`
33 - 47 | `0x21-0x2F` | `!"#$%&'()*+,-./` | `0` | `≠0` | `0` | `0` | `≠0` | `≠0` | `0` | `0` | `0` | `0` | `0` | `0`
48 - 57 | `0x30-0x39` | `0123456789` | `0` | `≠0` | `0` | `0` | `≠0` | `0` | `≠0` | `0` | `0` | `0` | `≠0` | `≠0`
58 - 64 | `0x3a-0x40` | `:;<=>?@` | `0` | `≠0` | `0` | `0` | `≠0` | `≠0` | `0` | `0` | `0` | `0` | `0` | `0`
65 - 70 | `0x41-0x46` | `ABCDEF` | `0` | `≠0` | `0` | `0` | `≠0` | `0` | `≠0` | `≠0` | `≠0` | `0` | `0` | `≠0`
71 - 90 | `0x47-0x5A` | `GHIJKLMNOPQRSTUVWXYZ` | `0` | `≠0` | `0` | `0` | `≠0` | `0` | `≠0` | `≠0` | `≠0` | `0` | `0` | `0`
91 - 96 | `0x5B-0x60` | `[\]^_`` | `0` | `≠0` | `0` | `0` | `≠0` | `≠0` | `0` | `0` | `0` | `0` | `0` | `0`
97 -102 | `0x61-0x66` | `abcdef` | `0` | `≠0` | `0` | `0` | `≠0` | `0` | `≠0` | `≠0` | `0` | `≠0` | `0` | `≠0`
103-122 | `0x67-0x7A` | `ghijklmnopqrstuvwxyz` | `0` | `≠0` | `0` | `0` | `≠0` | `0` | `≠0` | `≠0` | `0` | `≠0` | `0` | `0`
123-126 | `0x7B-0x7E` | `{|}~` | `0` | `≠0` | `0` | `0` | `≠0` | `≠0` | `0` | `0` | `0` | `0` | `0` | `0`
127 | `0x7F` | backspace character (`DEL`) | `≠0` | `0` | `0` | `0` | `0` | `0` | `0` | `0` | `0` | `0` | `0` | `0`

##### Conversions to numeric formats
Defined in header `<wchar.h>`
wcstolwcstoll (C95)(C99) | converts a wide string to an integer value (function) [edit]
wcstoulwcstoull (C95)(C99) | converts a wide string to an unsigned integer value (function) [edit]
wcstofwcstodwcstold (C99)(C95)(C99) | converts a wide string to a floating point value (function) [edit]
Defined in header `<inttypes.h>`
wcstoimaxwcstoumax (C99)(C99) | converts a wide string to intmax_t or uintmax_t (function) [edit]

##### String manipulation
Defined in header `<wchar.h>`
wcscpywcscpy_s (C95)(C11) | copies one wide string to another (function) [edit]
wcsncpywcsncpy_s (C95)(C11) | copies a certain amount of wide characters from one string to another (function) [edit]
wcscatwcscat_s (C95)(C11) | appends a copy of one wide string to another (function) [edit]
wcsncatwcsncat_s (C95)(C11) | appends a certain amount of wide characters from one wide string to another (function) [edit]
wcsxfrm (C95) | transform a wide string so that wcscmp would produce the same result as wcscoll (function) [edit]
##### String examination
Defined in header `<wchar.h>`
wcslenwcsnlen_s (C95)(C11) | returns the length of a wide string (function) [edit]
wcscmp (C95) | compares two wide strings (function) [edit]
wcsncmp (C95) | compares a certain amount of characters from two wide strings (function) [edit]
wcscoll (C95) | compares two wide strings in accordance to the current locale (function) [edit]
wcschr (C95) | finds the first occurrence of a wide character in a wide string (function) [edit]
wcsrchr (C95) | finds the last occurrence of a wide character in a wide string (function) [edit]
wcsspn (C95) | returns the length of the maximum initial segment that consists of only the wide characters found in another wide string (function) [edit]
wcscspn (C95) | returns the length of the maximum initial segment that consists of only the wide chars not found in another wide string (function) [edit]
wcspbrk (C95) | finds the first location of any wide character in one wide string, in another wide string (function) [edit]
wcsstr (C95) | finds the first occurrence of a wide string within another wide string (function) [edit]
wcstokwcstok_s (C95)(C11) | finds the next token in a wide string (function) [edit]

##### Wide character array manipulation
Defined in header `<wchar.h>`
wmemcpywmemcpy_s (C95)(C11) | copies a certain amount of wide characters between two non-overlapping arrays (function) [edit]
wmemmovewmemmove_s (C95)(C11) | copies a certain amount of wide characters between two, possibly overlapping, arrays (function) [edit]
wmemcmp (C95) | compares a certain amount of wide characters from two arrays (function) [edit]
wmemchr (C95) | finds the first occurrence of a wide character in a wide character array (function) [edit]
wmemset (C95) | copies the given wide character to every position in a wide character array (function) [edit]

### [edit] Types

Defined in header `<stddef.h>`
`wchar_t` | integer type that can hold any valid wide character
Defined in header `<wctype.h>`
`wint_t`(C95) | integer type that can hold any valid wide character and at least one more value
`wctrans_t`(C95) | scalar type that holds locale-specific character mapping
`wctype_t`(C95) | scalar type that holds locale-specific character classification

### [edit] Macros

Defined in header `<wchar.h>`
WEOF (C95) | a non-character value of type wint_t used to indicate errors (macro constant)
WCHAR_MIN (C95) | the smallest valid value of wchar_t (macro constant)
WCHAR_MAX (C95) | the largest valid value of wchar_t (macro constant)

### [edit] References

- C11 standard (ISO/IEC 9899:2011):

  - 7.19 Common definitions <stddef.h> (p: 288)

  - 7.29 Extended multibyte and wide character utilities <wchar.h> (p: 402-446)

  - 7.30 Wide character classification and mapping utilities <wctype.h> (p: 447-454)

  - 7.31.16 Extended multibyte and wide character utilities <wchar.h> (p: 456)

  - 7.31.17 Wide character classification and mapping utilities <wctype.h> (p: 457)

  - K.3.3 Common definitions <stddef.h> (p: 585)

  - K.3.9 Extended multibyte and wide character utilities <wchar.h> (p: 627-651)

- C99 standard (ISO/IEC 9899:1999):

  - 7.17 Common definitions <stddef.h> (p: 254)

  - 7.24 Extended multibyte and wide character utilities <wchar.h> (p: 348-392)

  - 7.25 Wide character classification and mapping utilities <wctype.h> (p: 393-400)

  - 7.26.12 Extended multibyte and wide character utilities <wchar.h> (p: 402)

  - 7.26.13 Wide character classification and mapping utilities <wctype.h> (p: 402)

- C89/C90 standard (ISO/IEC 9899:1990):

  - 4.1.5 Common definitions <stddef.h>

### [edit] See also

C++ documentation for Null-terminated wide strings

Retrieved from "http://en.cppreference.com/mwiki/index.php?title=c/string/wide&oldid=78817"