typedef struct {
int a;
} stu, *pstdu;
void func(stu **pst);
int main() {
stu *pst;
pst = (stu*)malloc(sizeof(stu));
pst->a = 10;
func(&pst);
}
void func(stu **pstu) {
/* how to access the variable a */
}
1) Want to access the structure variable a by passing the pointer address, in above function func.
2) In following case how it will behave example:
typedef struct {
int a;
} stu, *pstdu;
void func(pstdu *pst);
int main() {
stu *pst;
pst = (stu*)malloc(sizeof(stu));
pst->a = 10;
func(&pst);
}
void func(pstdu *pstu) {
/* how to access the variable a */
}