---
name: "offsetof"
section: "3"
platform: "freebsd"
package: "base"
version: "16.0-CURRENT-20261027-61c70dc16a79"
release: "FreeBSD 16.0-CURRENT (2026-10-27)"
platforms: ["linux", "freebsd"]
url: "https://new.carta.tech/offsetof"
---

# offsetof(3)

offset of a structure member

## NAME

**offsetof** – offset of a structure member

## SYNOPSIS

**#include \<stddef.h\>**

*size\_t*\

**offsetof**(*type*, *member*);

## DESCRIPTION

The **offsetof**() macro expands to an integer constant expression of type *size\_t* and yields the offset, in bytes, of the field *member* from the start of the structure *type*.

A compiler error will result if *member* is not aligned to a byte boundary (i.e. it is a bit-field).

## STANDARDS

The **offsetof**() macro conforms to ANSI X3.159-1989 (“ANSI C89”).
