home *** CD-ROM | disk | FTP | other *** search
/ SGI Developer Toolbox 6.1 / SGI Developer Toolbox 6.1 - Disc 4.iso / src / swtools / mipsABI / examples / before / index.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-08-02  |  513 b   |  32 lines

  1. /*
  2.  * illustrate the use of memory and string routines
  3.  *
  4.  */
  5.  
  6. #include <strings.h>
  7. #include <stdio.h>
  8.  
  9. extern int bcmp ();
  10. extern void bzero ();
  11. extern void bcopy ();
  12.  
  13. #define BUFFER 256
  14. char *string = "this is a test";
  15. char buf[BUFFER];
  16.  
  17. main ()
  18. {
  19.     int rv;
  20.     char *cp;
  21.  
  22.     bzero (buf, BUFFER);
  23.     bcopy (string, buf, strlen(string));
  24.     rv = bcmp (string, buf, strlen(string));
  25.     if ( rv == 0 )
  26.         printf ("Copied strings match\n");
  27.     cp = index (buf, 'a');
  28.     if (cp != NULL)
  29.         printf ("Found character in string\n");
  30.     
  31. }
  32.