C examples for stdlib.h:mblen
function
<cstdlib> <stdlib.h>
Get length of multibyte character
int mblen (const char* pmb, size_t max);
Parameter | Description |
---|---|
pmb | Pointer to the first byte of a multibyte character. |
max | Maximum number of bytes of pmb to consider. |
On success, it returns the size in bytes of the character pointed by pmb.
#include <stdio.h> #include <stdlib.h> int main()// w ww . j ava 2 s. c o m { const char str[] = "test string"; int len = mblen(str, sizeof(str)); printf("%d", len); return 0; }