home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Fish 'n' More 1
/
FishNMoreVol1.bin
/
more
/
code_examples
/
librar
/
intcomp.c
< prev
next >
Wrap
Text File
|
1989-02-08
|
896b
|
30 lines
/*--------------------------------------*/
/* */
/* INTCOMP(X,X,X) */
/* */
/* Compares the contents of two integer */
/* arrays. If the arrays are identical, */
/* a zero is returned. If the first ar- */
/* gument is smaller than the second, a */
/* -1 is returned. If the first argument*/
/* is greater than the second, then a 1 */
/* is returned. The third argument is */
/* the length of the compare. */
/* */
/*--------------------------------------*/
intcomp(a,b,c)
int a[],b[],c;
{
int j,x;
x=0;
for (j=0;j<c;j++){
if (a[j]!=b[j]){
if (a[j]>b[j])
x=1;
else
x=-1;
j=c;
}
}
return(x);
}