go语言byte类型报错cannot use "c" (type string) as type byte in assignment

  练习Go修改字符串的时候遇到这个问题:cannot use "c" (type string) as type byte in assignment,代码以下:html package main import "fmt" func main() { s := "hello" c := []byte(s) // 将字符串转为[]byte类型 c[0] = 'c' // by
相关文章
相关标签/搜索