/* Test126.c Swinehart July 13, 1982 12:05 PM */ struct Str1 { int a, b, c, d; }; /* Double "loopholes" cause address arithmetic problems. This particular example comes up when one normally passes around a pointer to an embedded structure, but occasionally wants to back up to the "encapsulation." Knowing the distance in words to back up, the method is to treat the original embedded pointer as an int*, adjust it, then recast it as the outer structure type. */ main() { struct Str1 *str1; str1->a &= 0177577; str1->c &= 0177576; str1->c = 5; str1->c = 5; str1->c = 5; str1->c = 5; str1->c = 5; str1->c = 5; str1->c = 5; str1->c = 5; str1->c = 5; str1->c = 5; str1->c = 5; str1->c = 5; };