Mega Code Archive

 
Categories / C / Code Snippets
 

Get the length of a multibyte character str

//Declaration: int mblen(const char *str, size_t size); #include <stdlib.h> #include <stdio.h> int main(void){ char *md = "rntsoft.com"; printf("%d", mblen(md, 2)); } /* 1*/