String
构造字符串:
#include <iostream> #include <string.h> using namespace std; int main() { string s1 = "qwertyuiopasdfghjklzxcvbnm" ; string s2 = s1 ; cout << s2 << endl ; string s3 (s2,1,5) ; cout << s3 << endl ; string s4 ("abcdefghjkl",5) ; cout << s4 << endl ; string s5 (10,'x') ; cout << s5 << endl ; string s6 (s1.begin(),s1.end()) ; cout << s6 << endl ; return 0; }