🐹 Go (Golang)
Beginner
How do pointers work in Go?
Answer
A pointer in Go holds the memory address of a value. Get the address of a variable with the & operator: p := &x. Dereference a pointer (access the value it points to) with the * operator: *p = 42. Go has no pointer arithmetic — you cannot increment or manipulate pointer addresses as in C. Passing a pointer to a function allows the function to modify the original value rather than a copy. Go's garbage collector tracks pointer reachability, so unlike C, you never manually free pointer memory.