R. Clayton (rclayton@clayton.cs.monmouth.edu)
(no date)
Is there another way to compare strings that ignores case? "==" does not
ignore case.
The string class doesn't support any. The easiest way to solve the problem is
to translate the strings to all lower (or upper) case before comparing. There
are stl algorithm that let you do it on one simple line, or you can do it
yourself in two slightly more complicated lines.
I was unsure of whether or not you wanted us to avoid using strcasecmp() or
if you didn't care either way.
I want to move you in the direction of writing standard code, and I don't want
you to gratuitously violate standards, but I'm not going to get all het up
about it right now.
If you don't care if we use strcasecmp() what file should I include so that
it compiles ok?
I am, however, going to compile your code to the standard, so you need to make
sure it compiles correctly; see section 18.13 of Deitel and Deitel for details.
This archive was generated by hypermail 2.0b3 on Fri Dec 21 2001 - 17:00:04 EST