Re: sorting std::vector<string> ignoring case



On Fri, 11 May 2007 22:03:40 -0600, Jerry Coffin <jcoffin@xxxxxxxxx> wrote:

In article <e7kCsV#kHHA.4876@xxxxxxxxxxxxxxxxxxxx>,
chololennon@xxxxxxxxxxx says...
Ok, I understand your "P.S." point. You're right. Only one thing: I didn't
say that _stricmp is ANSI compatible (I'm sorry again if I wasn't very clear
or very specfic). I suggested the use of _stricmp because (like you said) its
name it's conformant with standard (because it's declared inside string.h).

The name stricmp conformed just as well (all names starting with 'str'
are reserved, per section 7.26.11 of the C99 standard, or 7.13.8 of the
original C89/90 standard).

Which was my "P.S." point. :)

Adding the leading underscore accomplished
nothing in this case.

Well, it did achieve consistency for the non-standard functions MS provides
as part of the CRT, but that's about it. If stricmp were ever to be
standardized, there would be a lot of pressure to be compatible with
existing practice, so I don't think leaving it alone would have hurt
anything.

--
Doug Harrison
Visual C++ MVP
.



Relevant Pages

  • Re: sorting std::vector ignoring case
    ... This is extremely nitpicking, but I believe stricmp and _stricmp are ... I thought you were saying to avoid stricmp because it isn't "ANSI ... However, like I said, "neither are Standard C functions". ...
    (microsoft.public.vc.stl)
  • Re: sorting std::vector ignoring case
    ... I suggested the use of _stricmp because its ... name it's conformant with standard. ... I thought you were saying to avoid stricmp because it isn't "ANSI ... way, so is stricmp, for the reasons I gave in the "P.S." part of my earlier ...
    (microsoft.public.vc.stl)
  • Re: sorting std::vector ignoring case
    ... I suggested the use of _stricmp because its ... name it's conformant with standard. ... The universe is a figment of its own imagination. ...
    (microsoft.public.vc.stl)
  • Re: Compare without regard to case
    ... >> comparing two strings without regard to case. ... stricmp is not standard C or C++. ...
    (comp.lang.cpp)

Loading