I’ve tried all the ways I can think of to convert type *int32 to type *int64 in Go, but no avail
https://go.dev/play/p/W2X0HEnn79q
Somebody help please.
>Solution :
You cannot convert an *int32 to *int64. One is a pointer pointing to a 4-byte location, the other is a pointer pointing to an 8-byte location.
You can convert the content of *int32 to int64, and get the address of that:
x:=int32(1) // x is int32
xPtr:=&x // xPtr is *int32
y:=int64(*xPtr) // y is int64
yPtr:=&y // yPtr is *int64