- 论坛徽章:
- 0
|
本帖最后由 canigreen 于 2012-04-26 11:59 编辑
- #include <stdio.h>
- #include <string.h>
- struct s
- {
- char i[10];
- char j[10];
- };
- void p(s da);
- int main()
- {
- struct s st;
- strcpy(st.i,"SinSc");
- strcpy(st.j,"Microsoft");
- p(&st);
- //printf("%s %s\n",st.i,st.j);
- return 0;
- }
- void p(s da)
- {
- printf("%s----%s\n",da.i,da,j);
- strcpy(da.i,"1");
- strcpy(da.j,"2");
- }
复制代码 编译后出现这样的问题- [root@H0040 liao_update]# gcc struct.c
- struct.c:8: error: expected ‘)’ before ‘da’
- struct.c:18: error: expected ‘)’ before ‘da’
复制代码 我是C白痴,还请高手帮忙看一下,谢谢
|
|