#include<stdio.h>
struct s_{
int b;
}s;
int func1(s** ss){
*ss->a = 10;
}
int func(s* t){
func1(&t);
}
int main(){
s a;
func(&a);
printf("
a : %d
",a.b);
return 0;
}
Trying the sample program and getting an error with the o/p.
o/p:
[root@rss]# gcc d.c
d.c:6: error: expected ‘)’ before ‘*’ token
d.c:9: error: expected ‘)’ before ‘*’ token
d.c: In function ‘main’:
d.c:13: error: expected ‘;’ before ‘a’
d.c:14: error: ‘a’ undeclared (first use in this function)
d.c:14: error: (Each undeclared identifier is reported only once
d.c:14: error: for each function it appears in.)
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…