home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / magazine / pctech / 1988_02 / bench2.c < prev    next >
Text File  |  1983-08-03  |  640b  |  25 lines

  1.  
  2. #include "stdio.h"
  3. int bench2()
  4.  {
  5.     int i ;
  6.     char s[501] , s2[501] ;
  7.  
  8.     for(i=0 ; i < 500 ; i=i+1 )
  9.        { s[i] = 'a' ; } ;
  10.     s[500] = '\0' ;
  11.  
  12.     for( i=0 ; i < 100 ; i=i+1 )
  13.        { scopy(s2,s) ; } ;
  14.  }
  15.  
  16.          
  17. int scopy(to,from)     /* string copy function */
  18.  char *to ;         /* pointer to destination string */
  19.  char *from ;       /* pointer to source string */
  20.  {
  21.     while( (*to++ = *from++) != '\0' ) /* check for end of string */
  22.       { ; } ; /* copy one char and advance ptrs */
  23.  }
  24.  
  25.