Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int length(char* string_ptr){
- int count = 0;
- char *p = string_ptr;
- while (*p != 0)
- {
- if ((*p & 0x80) == 0 || (*p & 0xc0) == 0xc0)
- count++;
- p++;
- }
- return count;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement