- 链接地址:https://blog.csdn.net/weixin_30517001/article/details/96552471
- 链接标题:go语言byte类型报错cannot use "c" (type string) as type byte in assignment-CSDN博客
- 所属网站:blog.csdn.net
- 被收藏次数:4693
文章浏览阅读1w次。 练习Go修改字符串的时候遇到这个问题:cannot use "c" (type string) as type byte in assignment,代码如下:package mainimport "fmt"func main() { s := "hello" c := []byte(s) // 将字符串转为[]byte类型 c[0] = 'c' ..._cannot use value.(string) (comma, ok expression of type string) as []byte va
版权声明:本文发布于特牛网址导航 内容均来源于互联网 如有侵权联系删除