1.函数的数组参数退化为指针
2.参考代码:
#include <stdio.h>
#include <stdlib.h>
int main()
{
int a[5] = { 1, 2, 3, 4, 5 };
int* p1 = ( int* )( &a + 1 );
int* p2 = ( int* )( ( int )a + 1 );
int* p3 = ( int* )( a + 1 );
printf ( "%d, %d, %d\n", p1[-1], p2[0], p3[1] );
system ( "pause" );
return 0;
}
运行结果:
转载于:https://blog.51cto.com/chen0547/2045441