string str1("someString");
string str2 = string(str1);//how many copies are made here
//copy2 = copy1?
Run Code Online (Sandbox Code Playgroud)
当您使用字符串(otherString)分配字符串时,是否会复制括号中的值,然后将该值复制到变量中?
| 归档时间: |
|
| 查看次数: |
92 次 |
| 最近记录: |