home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Fish 'n' More 1
/
FishNMoreVol1.bin
/
more
/
code_examples
/
librar
/
find_len.c
< prev
next >
Wrap
Text File
|
1989-02-08
|
971b
|
40 lines
/*--------------------------------------*/
/* */
/* FIND_LENGTH(X,X) */
/* */
/* Functionality: */
/* Finds the first byte starting */
/* from the right of a character */
/* array that is a non-blank. */
/* Arguments: */
/* 0: The character array. */
/* 1: Its length. */
/* Returns: The number of the byte */
/* satisfying the above */
/* condition. A zero is */
/* returned if no trailing */
/* blanks are found. */
/* Author: John Callicotte */
/* Date created/modified: 09/01/88 */
/* */
/*--------------------------------------*/
find_length(a,b)
int b;
char a[];
{
int flag,x,j;
flag=0;
x=b;
for (j=x-1;j>=0;j--){
if (a[j]!=32){
x=j+1;
flag=1;
j=-1;
}
}
if (x==b && !flag) /* Were there no trailing blanks? */
x=0;
return(x);
}