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
相關文章
相關標籤/搜索