how can i use the next struct with typedef by passing it to another function like that?
I have tried this code but i doesn't seem to be working.
typedef struct stru{
int num;
} stru;
int main(void)
{
stru current;
struc(¤t);
printf("%d", current.num);
}
int struc(stru* current)
{
*current.num = 1;
return 0;
}
It didn't worked because its not the right way to set it to 1 i guess can someone help me to do it , i have tried few other ways but neither of them is working
*current.num = 1;
current->num = 1;postfix has higher precedence than unary.