Nico Heinze wrote:
> BTW if you will work solely under Windows for the rest of your life,
> you may use the stricmp() function; this is a strcmp() derivative
> which takes care of uppercase and lowercase letters considered
> identical.

If you will work solely under Windows, you might as well use the MFC
CString class, then you _can_ use the == operator.

CString string1, string2;

if (string1 == string2)
{
      // same name
}
else
{
      // different names
}

Or, to ignore case:

if (string1.CompareNoCase(string2))
{
      // different names
}
else
{
      // same name
}


NOTE that the Compare/CompareNoCase methods have opposite meaning to the
== operator.  == returns true (non-zero) if the two strings are
identical; Compare/CompareNoCase return zero if they are identical, >0
or <0 if different, depending on collating order.  Same return values as
the strcmp function in C.

HTH.


To unsubscribe, send a blank message to <mailto:[EMAIL PROTECTED]>.


Yahoo! Groups Sponsor
ADVERTISEMENT
click here
Web Bug from http://us.adserver.yahoo.com/l?M=298184.5639630.6699735.3001176/D=groups/S=:HM/A=2434971/rand=397684405


Yahoo! Groups Links

Reply via email to