-
Notifications
You must be signed in to change notification settings - Fork 885
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
翻转字符串 #19
Comments
切片是在原有数组上进行操作的,而字符串本质上是一个字节数组,因而不会再开辟一块新的内存空间。 详情请翻阅:https://learnku.com/docs/the-way-to-go/the-application-of-76-strings-arrays-and-slices/3617 |
字符串是不可修改的, 字节数组是可以修改的,不会开辟一块新内存??那字节数组改了, 字符串会变吗? |
字节数组转换为字符串,字符串转换为字节数组都会发生内存copy。具体查看这里:类型转换 |
所以, 这个题目看起来不是很靠谱吧 |
错别字好像有点多 |
前两个算法题的答案看起来都很不靠谱,当然也可能是题目没说清楚。 |
这个题目,不发生内存拷贝?? 讲道理, 字符串数组转换成[]rune切片, 就已经发生了内存拷贝了好吧
The text was updated successfully, but these errors were encountered: