Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!swrinde!ucsd!rutgers!pyrnj!pyrdc!eliot!reidc From: reidc@eliot.UUCP (Reid Carson/Development) Newsgroups: comp.lang.c Subject: Re: index and rindex question... Summary: Broken index/rindex Message-ID: <510@eliot.UUCP> Date: 5 Feb 90 03:56:55 GMT References: <11716.25C6818B@urchin.fidonet.org> <22236@mimsy.umd.edu> Organization: Unitech Software, Inc., Reston, VA Lines: 17 In article <22236@mimsy.umd.edu>, chris@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.