home *** CD-ROM | disk | FTP | other *** search
/ Il CD di internet / CD.iso / SOURCE / D / CLISP / CLISPSRC.TAR / clisp-1995-01-01 / amiga / jchlib / misc / strlen.c < prev   
Encoding:
C/C++ Source or Header  |  1994-07-09  |  273 b   |  16 lines

  1. #if 0
  2. int strlen(const char* str)
  3. {
  4.   register int count;
  5.   for (count = 0; *str != '\0'; count++, str++) ;
  6.   return count;
  7. }
  8. #else /* better optimisation */
  9. int strlen(const char* str)
  10. {
  11.   register int count = 0;
  12.   while (!(*str++ == 0)) count++;
  13.   return count;
  14. }
  15. #endif
  16.