# SHZ_CONTAINER_OF

Source: https://sh4zam.com/api/cdefs/SHZ_CONTAINER_OF/

```c
#define SHZ_CONTAINER_OF(ptr, type, member) ((type*)((char*)(ptr) - offsetof(type, member)))
```

Returns the containing structure from a pointer to one of its members.

## Parameters

| Name | Type | Description |
| --- | --- | --- |
| `ptr` |  |  |
| `type` |  |  |
| `member` |  |  |

## Availability

- **C++ equivalent:** none (usable from C++ as is)
- **Back-ends:** n/a (not a function)
- **Defined in:** [`sh4zam/shz_cdefs.h:135`](https://github.com/gyrovorbis/sh4zam/blob/ba1e30c88d49df0311870b229e1dd860ef26c477/include/sh4zam/shz_cdefs.h#L135)
- **Module:** [Compiler Definitions](https://sh4zam.com/api/cdefs/), section "Utilities"
