|
发表于 2004-11-4 02:12:06
|
显示全部楼层
出现了Segmentation fault.错误,先检查一下你的代码有没有一下错误:
1.Trying to write to a NULL pointer, eg
[PHP]
char *foo = NULL;
strcpy(foo, "bang!");
[/PHP]
2.Using a pointer that has not been initialized, eg
[PHP]
char *foo;
strcpy(foo, "bang!");
[/PHP]
3.Trying to access past the end of an array, eg
[PHP]
int bar[20];
bar[27] = 6;
[/PHP]
4.Trying to store something in read-only memory, eg
[PHP]
char *foo = "My string";
strcpy(foo, "bang!");
[/PHP]
5.Doing naughty things with malloc() and free(), eg
[PHP]
char bar[80];
free(bar);
[/PHP]
or
[PHP]
char *foo = malloc(27);
free(foo);
free(foo);
[/PHP] |
|