我觉得不需转换成numeric值直接比较应该也是可行的。 >,<,== or str1.Compare(str2);
please notice thisCString::Compare int Compare( LPCTSTR lpsz ) const;Return ValueZero if the strings are identical, < 0 if this CString object is less than lpsz, or > 0 if this CString object is greater than lpsz.
>,<,== or
str1.Compare(str2);
int Compare( LPCTSTR lpsz ) const;Return ValueZero if the strings are identical, < 0 if this CString object is less than lpsz, or > 0 if this CString object is greater than lpsz.
不转换成数值直接比较会出问题,如:
"-12"> "-11",但-12 < -11。
12.000000的问题就繁了一些