index

Larry Lippman larry at kitty.UUCP
Mon Jul 29 08:59:01 AEST 1985


> What is the BSD function "index" supposed to do?  Does anyone
> know the equivalent on a System V Release 2 machine?

I have System V Release 2.2 on 3B2's and have used the index(3F) function
in Fortran applications.  The function is called from a Fortran program and
returns the location (i.e., integer character count) of the substring <cs2>
in the character string <cs1>.  It works like this:

	integer i
	character*len1 cs1
	character*len2 cs2

	i=index(cs1,cs2)

Index is similar to the C language function 'strspn'.
	
I am not a BSD person, so I can't tell you if BSD does anything different
from the above.

	Larry Lippman
	Recognition Research Corp.
	Clarence, New York
	UUCP	{decvax,dual,rocksanne,rocksvax,watmath}!sunybcs!kitty!larry
		{rice,shell}!baylor!kitty!larry
		syr!buf!kitty!larry
	VOICE	716/741-9185
	TELEX	{via WUI} 69-71461 answerback: ELGECOMCLR

	"Have you hugged your cat today?"



More information about the Comp.lang.c mailing list