TIP: Click on subject to list as thread! ANSI
echo: cis.languages
to: Bill Dickhaus 70325,523 (X)
from: Carl Kreider 71076,76
date: 1992-12-23 14:43:14
subject: #17255-#C question

#: 17280 S3/Languages
    23-Dec-92  14:43:14
Sb: #17255-#C question
Fm: Carl Kreider 71076,76
To: Bill Dickhaus 70325,523 (X)

Bill,
Here is the classical method of finding a struct element offset, if this
is what you meant.

#define offsetof(t, m)  (&(((t *)0)->m))

typedef struct {
    char    a;
    int     b;
    short   c;
    } X;

main()
    {
    printf("offsetof(b) = %d\n", offsetof(X, b));
    }

There is 1 Reply.

SOURCE: compuserve via textfiles.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.