warning: assignment from incompatible pointer type [enabled by default]
当我编译以下代码时,我得到了:
int main() {
int (*aptr) [5] = NULL;
int arr[5] = {1,2,3,4,5};
aptr = &arr[0];
printf("aptr = %p\n arr = %p\n", aptr, &arr[0]);
return 0;
}
我得到正确的输出:
aptr = 0xbfcc2c64
arr = 0xbfcc2c64
但是为什么我会收到指针类型不兼容的警告?