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 | |
|
|
Yahoo! Groups Links
- To visit your group on the web, go to:
http://groups.yahoo.com/group/c-prog/
- To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
- Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
