Borland C++ reference

mbstowcs

raw OCR

Converts a multibyte string to a wchart array.

Defined in header <stdlib.h>

Syntax

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

Portability

DOSUNIXWindowsANSI CC++ only
■■■

Remarks

The function converts the multibyte string s into the array pointed to by pwcs. No more than n values are stored in the array. If an invalid multibyte sequence is encountered, mbstowcs returns (size_t) -1.

The pwcs array will not be terminated with a zero value if mbstowcs returns n.

Return value

If an invalid multibyte sequence is encountered, mbstowcs returns (size_t) -1. Otherwise, the function returns the number of array elements modified, not including the terminating code, if any.

See also

Differences from modern implementations

Nothing recorded yet.

Modern references

These are search links, not yet checked by hand.