Assume T1
and T2
are two types and the following struct is given:
struct s
{
T1 x;
T2 y;
}
Further, assume that we have an object of type struct s
:
struct s a;
From this, we can calculate a pointer to the second struct member of the object:
T2 *q = &s.y;
What I am looking for is a portable way to calculate from q
a pointer p
of type struct s *
such that p
points at the object a
.