#include <stdlib.h>size_t mbstowcs(wchar_t *out, const char *in, size_t size);
The mbstowcs( ) function converts the multibyte string pointed to by in into a wide-character string and puts that result in the array pointed to by out. Only size number of bytes will be stored in out.
In C99, out and in are qualified by restrict.
The mbstowcs( ) function returns the number of multibyte characters that are converted. If an error occurs, the function returns –1.
Related functions are wcstombs( ) and mbtowc( ).