Posted By

zava on 08/11/10


Tagged

textmate strlen


Versions (?)

strlen.c


 / Published in: C
 

  1. // Ansi string only!
  2.  
  3. int _strlen(const char* str)
  4. {
  5. const char* s = str;
  6. while (*s) s++;
  7. return s - str;
  8. }
  9.  
  10. int main()
  11. {
  12. printf("%d\n", _strlen("0123456789"));
  13. }

Report this snippet  

You need to login to post a comment.