DESCRIPTION
mbstowcs() converts a nul-terminated multibyte character string pointed to by
s to the corresponding wide-character string and stores it in the array pointed to by
pwcs. This function may modify the first at most
n elements of the array pointed to by
pwcs. Each character will be converted as if
mbtowc(3) is continuously called, except the internal state of
mbtowc(3) will not be affected.
For state-dependent encoding, mbstowcs() implies the multibyte character string pointed to by s always begins with an initial state.
These are the special cases:
-
pwcs == NULL
-
mbstowcs() returns the number of elements to store the whole wide-character string corresponding to the multibyte character string pointed to by s. In this case, n is ignored.
-
s == NULL
-
Undefined (may cause the program to crash).