Advertisement
qberik

Untitled

Oct 23rd, 2022
219
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.20 KB | None | 0 0
  1. int length(char* string_ptr){
  2. int count = 0;
  3. char *p = string_ptr;
  4. while (*p != 0)
  5. {
  6. if ((*p & 0x80) == 0 || (*p & 0xc0) == 0xc0)
  7. count++;
  8. p++;
  9. }
  10. return count;
  11. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement