06.08.2013 Views

pSOSystem System Calls - Read

pSOSystem System Calls - Read

pSOSystem System Calls - Read

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

mbstowcs pREPC+ <strong>System</strong> <strong>Calls</strong><br />

mbstowcs Converts a multibyte character string into a wide character string.<br />

#include <br />

size_t mbstowcs (<br />

wchar_t *pwcs, /* wide string */<br />

const char *s, /* original multibyte string */<br />

size_t n /* wide string length */<br />

Description<br />

Arguments<br />

Return Value<br />

Error Codes<br />

The mbstowcs() function converts a sequence of multibyte characters that begins<br />

in the initial shift state from the array pointed to by s into a sequence of<br />

corresponding codes and stores not more than n codes into the array pointed to by<br />

pwcs. No multibyte characters that follow a null character (which is converted into a<br />

code with value zero) will be examined or converted. Each multibyte character is<br />

converted as if by a call to the mbtowc() function, except that the shift state of the<br />

mbtowc() function is not affected.<br />

If copying takes place between objects that overlap, the behavior is undefined.<br />

pwcs Points to the array where mbstowcs() stores the converted string.<br />

s Points to the string to be converted.<br />

n Specifies the length of pwcs.<br />

If an invalid multibyte character is encountered, mbstowcs() returns (size_t)-1.<br />

Otherwise, it returns the number of array elements modified, not including a<br />

terminating zero code, if any.<br />

None.<br />

3-98 <strong>pSO<strong>System</strong></strong> <strong>System</strong> <strong>Calls</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!