有人可以告诉我我在这里做错了什么:
#include <stdio.h>
#include <string.h>
main()
{
int a = 3;
int aa = 2;
int *aaa;
*aaa = 10;
func(&a, &aa, aaa);
printf("%d\n",a);
printf("%d\n", *aaa);
}
void func(int *b, int *bb, int *bbb){
*b = *bb;
//int c = *bbb;
printf("%d---\n",*b);
//printf("%d c value \n",bbb);
}
运行时出现分段错误
gcc 编译器 gcc (GCC) 4.1.2,在 linux 上
这是错误:
>>gcc file.c -o file
file.c:14: warning: conflicting types for ‘func’
file.c:10: warning: previous implicit declaration of ‘func’ was here
>>./file
Segmentation fault