mblen : mblen « stdlib.h « C Tutorial






ItemValue
Header filestdlib.h
Declarationint mblen(const char *str, size_t size);
Functionreturns the length (in bytes) of a multibyte character pointed to by str. Only the first size number of characters are examined. It returns -1 on error.
ReturnIf str is null, then mblen() returns nonzero if multibyte characters have state-dependent encodings. If they do not, zero is returned.


#include <stdlib.h>
  #include <stdio.h>

  int main(void){
     char *md = "asdfasdf";

     printf("%d", mblen(md, 2));
  }
1








23.20.mblen
23.20.1.mblen