Standard library header <cwchar>

From cppreference.com
< cpp‎ | header
 
 
Standard library headers
Language support
Concepts
<concepts> (C++20)
Diagnostics
<system_error> (C++11)

Memory management
<memory_resource> (C++17)  
Metaprogramming
<type_traits> (C++11)
<ratio> (C++11)
General utilities
<utility>
<tuple> (C++11)
<optional> (C++17)
<variant> (C++17)
<any> (C++17)
<expected> (C++23)
<bitset>

<charconv> (C++17)
<format> (C++20)
<bit> (C++20)

Strings
<cstring>
<cwchar>
<cuchar> (C++11)

Containers
<flat_set> (C++23)
<span> (C++20)
<mdspan> (C++23)

Iterators
<iterator>
Ranges
<ranges> (C++20)
<generator> (C++23)
Algorithms
Numerics
<cfenv> (C++11)
<complex>
<numbers> (C++20)

Time
<chrono> (C++11)
Localization
<codecvt> (C++11/17*)
Input/output
<filesystem> (C++17)
<cstdio>
<cinttypes> (C++11)
<strstream> (C++98*)
Regular expressions
<regex> (C++11)
Concurrency support
<stop_token> (C++20)
<thread> (C++11)
<atomic> (C++11)
<stdatomic.h> (C++23)
<mutex> (C++11)
<shared_mutex> (C++14)
<condition_variable> (C++11)  
<semaphore> (C++20)
<latch> (C++20)
<barrier> (C++20)
<future> (C++11)

C compatibility
<cstdbool> (C++11/17/20*)  
<ccomplex> (C++11/17/20*)
<ctgmath> (C++11/17/20*)

<cstdalign> (C++11/17/20*)

<ciso646> (until C++20)

 

This header was originally in the C standard library as <wchar.h>.

This header is part of the null-terminated wide and multibyte strings libraries. It also provides some C-style I/O functions and conversion from C-style Date.

Macros

implementation-defined null pointer constant
(macro constant)
WEOF
a non-character value of type wint_t used to indicate errors
(macro constant)
WCHAR_MIN
the smallest valid value of wchar_t
(macro constant)
WCHAR_MAX
the largest valid value of wchar_t
(macro constant)

Types

conversion state information necessary to iterate multibyte character strings
(class)
unsigned integer type returned by the sizeof operator
(typedef)
wint_t integer type that can hold any valid wide character and at least one more value
calendar time type
(class)

Functions

String manipulation
copies one wide string to another
(function)
copies a certain amount of wide characters from one string to another
(function)
appends a copy of one wide string to another
(function)
appends a certain amount of wide characters from one wide string to another
(function)
transform a wide string so that wcscmp would produce the same result as wcscoll
(function)
String examination
returns the length of a wide string
(function)
compares two wide strings
(function)
compares a certain amount of characters from two wide strings
(function)
compares two wide strings in accordance to the current locale
(function)
finds the first occurrence of a wide character in a wide string
(function)
finds the last occurrence of a wide character in a wide string
(function)
returns the length of the maximum initial segment that consists
of only the wide characters found in another wide string
(function)
returns the length of the maximum initial segment that consists
of only the wide not found in another wide string
(function)
finds the first location of any wide character in one wide string, in another wide string
(function)
finds the first occurrence of a wide string within another wide string
(function)
finds the next token in a wide string
(function)
Wide character array manipulation
copies a certain amount of wide characters between two non-overlapping arrays
(function)
copies a certain amount of wide characters between two, possibly overlapping, arrays
(function)
compares a certain amount of wide characters from two arrays
(function)
finds the first occurrence of a wide character in a wide character array
(function)
copies the given wide character to every position in a wide character array
(function)
Multibyte/wide character conversion
checks if the std::mbstate_t object represents initial shift state
(function)
widens a single-byte narrow character to wide character, if possible
(function)
narrows a wide character to a single-byte narrow character, if possible
(function)
returns the number of bytes in the next multibyte character, given state
(function)
converts the next multibyte character to wide character, given state
(function)
converts a wide character to its multibyte representation, given state
(function)
converts a narrow multibyte character string to wide string, given state
(function)
converts a wide string to narrow multibyte character string, given state
(function)
Input/Output
gets a wide character from a file stream
(function)
gets a wide string from a file stream
(function)
writes a wide character to a file stream
(function)
writes a wide string to a file stream
(function)
reads a wide character from stdin
(function)
writes a wide character to stdout
(function)
puts a wide character back into a file stream
(function)
switches a file stream between wide character I/O and narrow character I/O
(function)
reads formatted wide character input from stdin, a file stream or a buffer
(function)
(C++11)(C++11)(C++11)
reads formatted wide character input from stdin, a file stream
or a buffer using variable argument list
(function)
prints formatted wide character output to stdout, a file stream or a buffer
(function)
prints formatted wide character output to stdout, a file stream
or a buffer using variable argument list
(function)
String conversions
converts a std::tm object to custom wide string textual representation
(function)
converts a wide string to an integer value
(function)
converts a wide string to an unsigned integer value
(function)
converts a wide string to a floating point value
(function)

Notes

Defect reports

The following behavior-changing defect reports were applied retroactively to previously published C++ standards.

DR Applied to Behavior as published Correct behavior
LWG 345 C++98 std::tm was not provided in <cwchar> provided