码:
string str = "Whats up"; char *c = new char[str.length() + 1];
我仍然可以写 char *c = new char[str.length()];
char *c = new char[str.length()];
在长度上添加+1有什么意义?
c++ string
c++ ×1
string ×1