mbstowcs

Converts a sequence of multibyte characters into their corresponding wide-character codes and stores them in an array (nonoperational in NetWare versions 3.11 and earlier)

Local Servers:nonblocking
Remote Servers:N/A
Classification:ANSI
Service:Character Manipulation

Syntax

  #include <stdlib.h> 
    
  size_t mbstowcs  (  
     wchar_t      *pwcs,   
     const char   *s,   
     size_t        n);
  

Parameters

pwcs
(OUT) Points to the array of wide-character codes.
s
(IN) Points to the array of multibyte characters to be converted.
n
(IN) Specifies the number of codes to be stored in the array pointed to by pwcs.

Return Values

mbstowcs returns the actual number of bytes that have been copied from the array pointed to by s to the array pointed to by pwcs. The returned value is always less than n.

Remarks

The mbstowcs function converts a sequence of multibyte characters pointed to by s into their corresponding wide-character codes and stores not more than n codes into the array pointed to by pwcs.

The mbstowcs function does not convert any multibyte characters beyond the NULL character. At most, n elements of the array pointed to by pwcs are modified.

This function is currently implemented for single-byte character coding only.

See Also

mblen, mbtowc, wcstombs, wctomb