Microsoft Foundation Classes (mfc.hlp) (Table of Contents; Topic list)
CString::Compare
CString                                     Up Contents Index Back
──Microsoft Foundation Classes──────────────────────────────────────────────
 
  int Compare( const char* psz ) const;
 
  Parameter   Description
 
  <psz>       The other string used for comparison.
 
  Remarks
 
  Compares this CString object with another string, character by
  character; uses the run-time function strcmp. If you need a
  language-specific comparison, use the Collate member function.
 
  Return Value
 
  0    The strings are identical.
  -1   This CString object is less than <psz>.
  1    This CString object is greater than <psz>.
 
  Example
 
  CString s1( "abc" );
  CString s2( "abd" );
  ASSERT( s1.Compare( s2 ) == -1 ); // Compare with another CString
  ASSERT( s1.Compare( "abe" ) == -1 ); // Compare with a char * string
 
 
  See Also
 
  CString::CompareNoCase, CString::Collate
 
 
                                     -♦-