*** UNIX MANUAL PAGE BROWSER ***

A Nergahak database for man pages research.

Navigation

Directory Browser

1Browse 4.4BSD4.4BSD
1Browse Digital UNIXDigital UNIX 4.0e
1Browse FreeBSDFreeBSD 14.3
1Browse MINIXMINIX 3.4.0rc6-d5e4fc0
1Browse NetBSDNetBSD 10.1
1Browse OpenBSDOpenBSD 7.7
1Browse UNIX v7Version 7 UNIX
1Browse UNIX v10Version 10 UNIX

Manual Page Search

Manual Page Result

0 Command: offsetof | Section: 3 | Source: NetBSD | File: offsetof.3
OFFSETOF(3) FreeBSD Library Functions Manual OFFSETOF(3) 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). EXAMPLES Regardless of the architecture and the ABI, the following example prints the value zero for the variable x. struct example { double x; int y; char z; }; size_t x, y, z; x = offsetof(struct example, x); y = offsetof(struct example, y); z = offsetof(struct example, z); (void)printf("%zu %zu %zu\n", x, y, z); SEE ALSO __alignof__(3), stddef(3), typeof(3) STANDARDS The offsetof() macro conforms to ANSI X3.159-1989 ("ANSI C89"). FreeBSD 14.1-RELEASE-p8 April 1, 2011 FreeBSD 14.1-RELEASE-p8

Navigation Options