从stringto转换为[]byte分配新内存是真的吗?另外,从[]byteto转换是否会string分配新的内存? s := "a very long string" b := []byte(s) // does this doubled the memory requirement? b := []byte{1,2,3,4,5, ...very long bytes..} s := string(b) // does this doubled the memory requirement?
1 回答
- 1 回答
- 0 关注
- 249 浏览
添加回答
举报
0/150
提交
取消