Operator precedence and struct definition in C
Posted
by Yktula
on Stack Overflow
See other posts from Stack Overflow
or by Yktula
Published on 2010-03-17T01:41:36Z
Indexed on
2010/03/17
1:51 UTC
Read the original article
Hit count: 345
struct struct0 {
int a;
};
struct struct1 {
struct struct0 structure0;
int b;
} rho;
&rho->structure0; /* Reference 1 */
(struct struct0 *)rho; /* Reference 2 */
(struct struct0)rho; /* Reference 3 */
From reference 1, does the compiler take the address of rho, and then access structure0, or vice-versa?
What does the line at reference 2 do?
Since structure0 is the first member of struct1, would reference 3 be equivalent to reference 1?
© Stack Overflow or respective owner