Swift supports pointers, allowing you to pass references to values and records within your program.
zeroval doesn’t change the i in main, but zeroptr does because it has a reference to the memory address for that variable.
In Swift, direct pointer manipulation is considered unsafe and is generally discouraged. Instead, Swift provides safer alternatives like inout parameters for most use cases where you might use pointers in other languages. However, for the purpose of this example, we’ve used UnsafeMutablePointer to demonstrate the concept of pointers.