I need to get a pointer to a particular member variable of a structure
Here's what i have done
typedef struct
{
int var1;
other variables ...
} structname;
---some other code here---
structname* structptr;
int* intptr;
intptr=(int*)&(structptr->var1)
but this isn't working. What's the correct way to do this