home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / listings / v_02_03 / 2n03023b < prev    next >
Text File  |  1991-01-11  |  279b  |  18 lines

  1.  
  2.  
  3. /*
  4.  * Compare two int arrays, a and b.  Return 1 if, for
  5.  * all i from 0 to n-1, a[i] == b[i]; otherwise return
  6.  * 0.
  7.  */
  8. int equal(const int a[], const int b[], size_t n)
  9.     {
  10.     size_t i;
  11.  
  12.     for (i = 0; i < n; ++i)
  13.         if (a[i] != b[i])
  14.             return 0;
  15.     return 1;
  16.     }
  17.  
  18.