//: C03:IWCompare.cpp {-g++} // From "Thinking in C++, Volume 2", by Bruce Eckel & Chuck Allison. // (c) 1995-2004 MindView, Inc. All Rights Reserved. // See source code use permissions stated in the file 'License.txt', // distributed with the code package available at www.MindView.net. #include #include #include "iwchar_traits.h" using namespace std; int main() { // The same letters except for case: iwstring wfirst = L"tHis"; iwstring wsecond = L"ThIS"; wcout << wfirst << endl; wcout << wsecond << endl; assert(wfirst.compare(wsecond) == 0); assert(wfirst.find('h') == 1); assert(wfirst.find('I') == 2); assert(wfirst.find('x') == wstring::npos); } ///:~