Can you perform arithmetic operations on pointers in Go?

  • Depends on the type of pointer
  • No
  • Sometimes
  • Yes
No, you cannot directly perform arithmetic operations on pointers in Go like you can in languages such as C or C++. Go's pointer arithmetic is intentionally limited for safety and simplicity. Attempting to perform arithmetic on pointers will result in a compilation error.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *