You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You are printing a []int8 as though it were a []int32. The results will depend on the contents of memory locations that you are not setting. Your code sets a single byte to 5, and then prints the contents of four bytes starting at that single byte. If the other other three bytes don't happen to contain 0, you will see values other than 5. It's certainly possible for the fmt package to change those bytes, since you didn't allocate them.
This is not a bug, so closing. If you want to ask questions about Go, please use a forum, not the issue tracker. See https://golang.org/wiki/Questions. Thanks.
Uh oh!
There was an error while loading. Please reload this page.
go env
Outputfmt.Println the same x.c[0] twice, but got different result. why?
The text was updated successfully, but these errors were encountered: