|
以下为未解的问题:
1 #include <stdio.h>
2
3 void
4 ls()
5 {
6 printf("I love you too!");
7 }
8 struct a
9 {
10 void (*a)();
11 char *s;
12 };
13 struct a a[3];
14 int
15 main()
16 {
17 a[0]={ls,"I love you!"};
18 a[0].a();
19 printf("%s\n",a[0].s);
20 }
[root@localhost root]# gcc -g test1.c -o test1
test1.c: In function `main':
test1.c:17: parse error before '{' token
test1.c: At top level:
test1.c:18: parse error before '.' token
test1.c:19: parse error before string constant
test1.c:19: warning: conflicting types for built-in function `printf'
test1.c:19: warning: data definition has no type or storage class |
|