I have the following data design:
struct Info {
int i;
};
struct Data {
long data;
}
struct C {
Info I;
Data d;
};
int main() {
C c;
Data* d=&(c.d);
C* getOuterC(d);
}
Now I have a pointer to Data (Data*) that I know is inside a C struct. I would like to have a function C* getOuterC(Data*)
function returning a C pointer (C*) to the outer C structure containing Data. Any idea?