home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / listings / v_02_05 / 2n05062b < prev    next >
Text File  |  1991-03-27  |  385b  |  32 lines

  1.  
  2. #include <stdio.h>
  3.  
  4. char s[40000];
  5.  
  6. int strlen(const char s[])
  7.     {
  8.     int i = 0;
  9.  
  10.     while (s[i] != '\0')
  11.         ++i;
  12. #ifdef DEBUG
  13.     printf("%d\n", i);
  14. #endif
  15.     return i;
  16.     }
  17.  
  18. int main(void)
  19.     {
  20.     unsigned i;
  21.  
  22.     for (i = 0; i < 40000; ++i)
  23.         s[i] = 'x';
  24.     s[38000] = '\0';
  25.     printf("%u\n", strlen(s));
  26.     return 0;
  27.     }
  28.  
  29.  
  30.  
  31.  
  32.