A
arunaling
Hi all,
Can I write some macro which does something like this offset(s,x),
where s is the type of the structure and x is the name of the field in
the structure. offset has to return the position of the element in the
structure of type s.
For eg., if the structure is declared as struct s {int x, int y}. If
you give offset(s,x) return value should be 0. If you give
offset(s,y), return value should be 2. Is it possible to write such a
macro.
Thanks in advance.
Thanks and Regards,
Aruna
Can I write some macro which does something like this offset(s,x),
where s is the type of the structure and x is the name of the field in
the structure. offset has to return the position of the element in the
structure of type s.
For eg., if the structure is declared as struct s {int x, int y}. If
you give offset(s,x) return value should be 0. If you give
offset(s,y), return value should be 2. Is it possible to write such a
macro.
Thanks in advance.
Thanks and Regards,
Aruna