C Pointer Question: &(*struct->struct)
- by NTek
I have a struct defined with the structure as follows (names are different)
struct str1
{
int field1;
struct str2;
}
And I have a *str1 in a function. I'd like to get a pointer to str2.
So I tried &(str1->str2) and was hoping this would return a pointer to str2. Is this incorrect? It doesn't seem to be working. How would I get a pointer to str2 if given a pointer to str1?