Share via


CStringT::operator ==

Determines whether two strings are logically equal.

friend bool operator==(
   const CStringT& str1,
   const CStringT& str2
) throw();
friend bool operator==(
   const CStringT& str1
   PCXSTR psz2
) throw();
friend bool operator==(
   const CStringT& str1,
   PCYSTR psz2
) throw();
friend bool operator==(
   const CStringT& str1,
   XCHAR ch2
) throw();
friend bool operator==(
   PCXSTR psz1
   const CStringT& str2
) throw();
friend bool operator==(
   PCYSTR psz1
   const CStringT& str2,
) throw();
friend bool operator==(
   XCHAR ch1
   const CStringT& str2,
) throw();

Parameters

  • ch1
    An ANSI or Unicode character for comparison.

  • ch2
    An ANSI or Unicode character for comparison.

  • str1
    A CStringT for comparison.

  • str2
    A CStringT for comparison.

  • psz1
    A pointer to a null-terminated string for comparison.

  • psz2
    A pointer to a null-terminated string for comparison.

Remarks

Tests whether a string or character on the left side is equal to a string or character on the right side, and returns TRUE or FALSE accordingly.

Example

// typedef CStringT< TCHAR, StrTraitATL< TCHAR > > CAtlString;
CAtlString s1(_T("dog")), s2(_T("f")), s3(_T("dog"));

ASSERT(s1 == _T("dog"));
ASSERT(s2 == _T('f'));
ASSERT(s1 == s3);   

Requirements

Header: cstringt.h

See Also

Reference

CStringT Class

Other Resources

CStringT Members