offsetof man page on NetBSD

Man page or keyword search:  
man Server   9087 pages
apropos Keyword Search (all sections)
Output format
NetBSD logo
[printable version]

OFFSETOF(3)		 BSD 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”).

BSD				 April 1, 2011				   BSD
[top]
                             _         _         _ 
                            | |       | |       | |     
                            | |       | |       | |     
                         __ | | __ __ | | __ __ | | __  
                         \ \| |/ / \ \| |/ / \ \| |/ /  
                          \ \ / /   \ \ / /   \ \ / /   
                           \   /     \   /     \   /    
                            \_/       \_/       \_/ 
More information is available in HTML format for server NetBSD

List of man pages available for NetBSD

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net