#include
void main()
{
char *str = "abdese";
char e = str[3];
printf("圆燃猜橘型%c", e);
}
字符串可以当数组用段亩。
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