Format
#include <wchar.h> int mbsinit (const mbstate_t *ps);
Language Level: ANSI
Threadsafe: Yes
Description
If ps is not a null pointer, the mbsinit() function specifies whether the pointed to mbstate_t object describes an initial conversion state.
Return Value
The mbsinit() function returns nonzero if ps is a null pointer or if the pointed to object describes an initial conversion state. Otherwise, it returns zero.
Example that uses mbsinit()
This example checks the conversion state to see if it is the initial state.
#include <stdio.h> #include <wchar.h> #include <stdlib.h> main() { char *string = "ABC"; mbstate_t state = 0; wchar_t wc; int rc; rc = mbrtowc(&wc, string, MB_CUR_MAX, &state); if (mbsinit(&state)) printf("In initial conversion state\n"); }
Related Information
(C) Copyright IBM Corporation 1992, 2006. All Rights Reserved.