package main
import (
"fmt"
"strconv"
)
func main() {
i := make([]byte, 200)
i[0] = '1'
i[1] = '2'
i[2] = '3'
i[3] = '4'
var str = string(i)
fmt.Print(str, "\n") //1234
va, _ := strconv.Atoi(str)
fmt.Print(va) //0
}
为什么是0?
有疑问加站长微信联系(非本文作者)