3 ms·
> It is not like C and C++ where you have pointer arithmetic. You absolutely _can_ do pointer arithmetic—it just requires using the "unsafe" package for obviou
by thegeekpirate 5y ago
> It is not like C and C++ where you have pointer arithmetic.
You absolutely _can_ do pointer arithmetic—it just requires using the "unsafe" package for obvious reasons (https://go.dev/play/p/Batmgb1KJcg https://go.dev/play/p/Batmgb1KJcg).
Hell, there's even a helper function (https://pkg.go.dev/unsafe#Add https://pkg.go.dev/unsafe#Add) for addition!
- azth 5y agoCalling unsafe is not the point here. You can do similar things in Java if you really need to.