# * pointer operator

Source: https://ref.dm-lang.org/operator/asterisk/pointer
Added in BYOND 515.

### Format
> `*A`

### Returns
> The value pointed at by a pointer stored in A

This operator is also called the dereference operator, since it takes a pointer reference and gives you the value within.)

When using the `&` operator to get a reference pointer, you can access the value it points to with this version of the `*` operator. This can also be used on the left-hand side of assignment operations, for instance `*A = B` or `*X += Y`, to store the result in the place the pointer indicates.

```dm
atom/proc/PixelPos(px, py)  // get an exact step position
    *px = (x-1) * 32    // this code assumes a 32x32 icon size
    *py = (y-1) * 32

atom/movable/PixelPos(px, py)  // get an exact step position
    ..()
    *px += step_x   // this code assumes a 32x32 icon size
    *py += step_y

mob/verb/WhereAmI()
    var/X, Y
    PixelPos(&X, &Y)
    usr << "You are at [X],[Y] on level [z]"
```

> [!note]
> 
> If you try to read to or write from a pointer reference that is no longer valid, such as to a var inside a proc that has ended, the read or write will fail silently; reading will return a null value. (An exception is pointers to list items. If the index is out of bounds, you will get the expected error.)

### See also
- [& pointer operator](https://ref.dm-lang.org/operator/amp/pointer.md)
- [operators](https://ref.dm-lang.org/operator/index.md)
- [ispointer proc](https://ref.dm-lang.org/proc/ispointer.md)
