#include <string>
// dynamic
string s1 = new string("helloworld");
// static
string s2 = "robin";
int s2len = s2.length();
s2 += "chen";
s2.substr(3,4);
s2.append("Jr.");
size_t ind = s2.find('c');
#include <cstring>
// copy to char array (mutable)
const char *cstr = s2.c_str();
cout << "c_string (char arry) = " << cstr << endl;
// copy to an non-mutable char array
char *cstr2 = new char[s2.length() + 1];
strcpy(cstr2, s2.c_str());
cstr2[5]='z';
cout << "cstr2 = " << cstr2 << endl;
delete [] cstr2;