An array is a vector of values in memory. A slice is a small struct that
describes an array stored elsewhere in memory.
https://blog.golang.org/go-slices-usage-and-internals
--
You received this message because you are subscribed to the Google Groups
"golang-nuts" group.
To unsubscribe from th
hello,
This piece of code prints [10 0 0 0] as expected..
func main() {
i := 10
p := unsafe.Pointer(&i)
intPtr := (*[4]byte)(p)
fmt.Println(*intPtr)
}
But if I convert the unsafe.Pointer to pointer to a byte slice rather than
an array of 4 bytes it prints an empt