Mail Archives: djgpp/1997/08/08/22:25:47
Chris Croughton wrote:
>
> Robert Hoehne wrote:
>
> > Use strcasecmp() instead, which is more partable
> > and the same.
>
> In what way is strcasecmp more portable than stricmp?
> I've never seen strcasecmp on any other compiler, and
> stricmp is at least standard on PC compilers and a lot
> of the older Unices (Borland, at least, had 'strcmpi'
> as a macro alias for 'stricmp').
>
> The fact is, there is no portable case-independent
> string comparison function unless you write it yourself.
> It's one of the oddities in the ANSI library - Plauger
> just says "The set of functions is incomplete and
> inconsistent", but doesn't mention case-independent
> compare as one of the lacks. Strange, since most
> implementations before the ANSI deliberations did
> include it (either stricmp or strcmpi, sometimes also
> combinations like strnicmp) and much of the ANSI string
> deliberations were about locale issues where case folding
> would logically have a place.
I don't know why, but probably you have misunderstood me.
I have not said, that strcasecmp is portable or any
ANSI function, I simply said that it is more partable,
because at least in the GNU programming environment this
function is known.
Robert
--
*****************************************************************
* Robert Hoehne, Fakultaet fuer Mathematik, TU-Chemnitz-Zwickau *
* Post: Am Berg 3, D-09573 Dittmannsdorf *
* e-Mail: Robert DOT Hoehne AT Mathematik DOT TU-Chemnitz DOT DE *
* WWW: http://www.tu-chemnitz.de/~rho *
*****************************************************************
- Raw text -