为了账号安全,请及时绑定邮箱和手机立即绑定

关于 Golang 中 []byte 和 string 转换的技术问题

关于 Golang 中 []byte 和 string 转换的技术问题

Go
ITMISS 2021-09-09 15:23:47
从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 关注
  • 254 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号