I tried to compile this example:
#include <stdio.h>
#include <stdlib.h>
#include <stddef.h>
main(){
size_t distance;
struct x{
int a, b, c;
}s_tr;
distance = offsetof(s_tr, c);
printf("Offset of x.c is %lu bytes\n",
(unsigned long)distance);
exit(EXIT_SUCCESS); }
I got an error: error expected specifier-qualifier-list before 's_tr'. what does it mean? The example i got from: http://publications.gbdirect.co.uk/c_book/chapter9/introduction.html