void f1(struct ha * p2){
printf("%d\n",p2->b);
}
struct ha {
int a=2;
int b=3;
};
int main(void){
struct ha d;
f1(&d);
}C:\Users\zberty\Desktop\1.c...
[Warning] C:\Users\zberty\Desktop\1.c:3: warning: "struct ha" declared inside parameter list
[Warning] C:\Users\zberty\Desktop\1.c:3: warning: its scope is only this definition or declaration, which is probably not what you want
[Error] C:\Users\zberty\Desktop\1.c:4: error: dereferencing pointer to incomplete type
[Warning] C:\Users\zberty\Desktop\1.c:7: warning: no semicolon at end of struct or union
[Error] C:\Users\zberty\Desktop\1.c:7: error: syntax error before '=' token
[Error] C:\Users\zberty\Desktop\1.c:9: error: syntax error before '}' token
[Error] C:\Users\zberty\Desktop\1.c:11: error: storage size of 'd' isn't known
编译中止 C:\Users\zberty\Desktop\1.c: 4 个错误, 3 个警告
谢谢