home *** CD-ROM | disk | FTP | other *** search
-
- #include "stdio.h"
- int bench2()
- {
- int i ;
- char s[501] , s2[501] ;
-
- for(i=0 ; i < 500 ; i=i+1 )
- { s[i] = 'a' ; } ;
- s[500] = '\0' ;
-
- for( i=0 ; i < 100 ; i=i+1 )
- { scopy(s2,s) ; } ;
- }
-
-
- int scopy(to,from) /* string copy function */
- char *to ; /* pointer to destination string */
- char *from ; /* pointer to source string */
- {
- while( (*to++ = *from++) != '\0' ) /* check for end of string */
- { ; } ; /* copy one char and advance ptrs */
- }
-