ChatGPT解决这个技术问题 Extra ChatGPT

How to change int into int64?

go

Im trying to convert an integer into an integer64 in go but im having no luck. Anyone know an easy way to do this?

If you showed your code sample why it does not work. It works for me. play.golang.org/p/63GWAs8XAq

D
Denys Séguret

This is called type conversion :

i := 23
var i64 int64
i64 = int64(i)

I was doing (int64)i, it din't work, old habit from clang. This reverse from C++ worked.
R
Ryan Walls

This is probably obvious, but simplest:

i64 := int64(23)

A
Anupam Ghosh
i := 23
i64 := int64(i)
fmt.Printf("%T %T", i, i64) // to print the data types of i and i64

is it possible to use LL as postfix like c/c++?