我有以下代碼,使用C的指針涉及 void
f(void)
{
int a[4];
int *b = malloc(16);
int *c;
int i;
printf("1: a = %p, b = %p, c = %p\n", a, b, c);
c = a;
for (i = 0; i < 4; i++)
此代碼給出分段錯誤。由GDB調試它給這個錯誤: "Program received signal SIGSEGV, Segmentation fault. 0x00007ffff7a6dde5 in _IO_vfscanf_internal (s=, format=, [email protected]=0x7fffffffdba8, [email protected]=0x0) at vfsca