This repository has been archived on 2024-12-16. You can view files and clone it, but cannot push or open issues or pull requests.
CodeBlocksPortable/WATCOM/samples/clibexam/offsetof.c

17 lines
306 B
C

#include <stdio.h>
#include <stddef.h>
struct new_def
{ char *first;
char second[10];
int third;
};
void main()
{
printf( "first:%d second:%d third:%d\n",
offsetof( struct new_def, first ),
offsetof( struct new_def, second ),
offsetof( struct new_def, third ) );
}