I have just read Extending a struct in C and I don't seem to understand what certain part of the code does.
Here is his current code:
typedef struct A {
int x;
}A;
typedef struct B {
A a;
int d;
}B;
void fn(){
B *b;
((A*)b)->x = 10;
}
I wonder, how does ((A*)b)->x = 10; become the same as b->a.x = 10;?
How do you interpret that line of code?
EDIT
What do (A*) and (A*)b do?
