第2个回答 推荐于2016-02-18
string str="abdese";
char ch = str[3];
string s("What we have here is a failure to communicate");
string sub = s.substr(21);
cout << "The original string is " << s << endl;
cout << "The substring is " << sub << endl;
displays
The original string is What we have here is a failure to communicate
The substring is a failure to communicate本回答被提问者采纳