Strings(Chapter 1 of Thinking in C++ Vol 2)
时间:2010-12-11 来源:Ray Z
Main
1 #include "ichar_traits.h"
2 #include <string>
3 #include <iostream>
4 using namespace std;
5
6 typedef basic_string<char, ichar_traits, allocator<char> > istring;
7
8 int main()
9 {
10 istring first = "tHis";
11 istring second = "ThIs";
12 cout << first.compare(second) << endl;
13 cin.get();
14 }
2 #include <string>
3 #include <iostream>
4 using namespace std;
5
6 typedef basic_string<char, ichar_traits, allocator<char> > istring;
7
8 int main()
9 {
10 istring first = "tHis";
11 istring second = "ThIs";
12 cout << first.compare(second) << endl;
13 cin.get();
14 }
相关阅读 更多 +