C指针和函数指针问题

时间:2013-09-05 10:46:32

标签: pointers function-pointers

我的环境是fedora 17 64位 指针:

int a[5] = {1,2,3,4,5};
int *p = (*int)(&a+1);
The value of *(p-1) is 5.
Assume &a is 0x7fffffffdf50.
I wonder know why (&a+1) is 0x7fffffffdf64 and why *(p-1) is 5? 

Function pointer:
Re-write 
void(*(*(fptr[5])(char*);
to
typedef_______?_______;
pf(*fptr)[5];

1 个答案:

答案 0 :(得分:0)

将指针赋值更正为

int *p = (int*)(&a+1);