Advances to the next multibyte character.
Standard C Library (libc.a)
#include <mbstr.h>
char *mbsadvance ( S)
const char *S;
The mbsadvance subroutine locates the next character in a multibyte character string. The LC_CTYPE category affects the behavior of the mbsadvance subroutine.
Item | Description |
---|---|
S | Contains a multibyte character string. |
If the S parameter is not a null pointer, the mbsadvance subroutine returns a pointer to the next multibyte character in the string pointed to by the S parameter. The character at the head of the string pointed to by the S parameter is skipped. If the S parameter is a null pointer or points to a null string, a null pointer is returned.
To find the next character in a multibyte string, use the following:
#include <mbstr.h>
#include <locale.h>
#include <stdlib.h>
main()
{
char *mbs, *pmbs;
(void) setlocale(LC_ALL, "");
/*
** Let mbs point to the beginning of a multi-byte string.
*/
pmbs = mbs;
while(pmbs){
pmbs = mbsadvance(mbs);
/* pmbs points to the next multi-byte character
** in mbs */
}