index and rindex question...

Reid Carson/Development reidc at eliot.UUCP
Mon Feb 5 14:56:55 AEST 1990


In article <22236 at mimsy.umd.edu>, chris at mimsy.umd.edu (Chris Torek) writes:

> Unless there are some *extremely* broken systems out there (this is
> always a possibility), there are no systems on which index() and rindex()
> return an int.
> 
> index and rindex, wherever present, should be EXACTLY identical to
> strchr and strrchr ...

  On at least one version of Masscomp's UNIX I've used, index/rindex exist,
as well as strchr/strrchr.  The functions work identically, EXCEPT, that
index/rindex return -1 (cast to a pointer, I suppose), in case of no match,
rather than a null pointer.  Mind, this was some time ago, and I would imagine
it's been fixed by now, but verbum sap.
-- 
Reid W. Carson (uunet!pyrdc!eliot!reidc)  -  Unitech Software, Inc.
What I tell you three times is true.



More information about the Comp.lang.c mailing list