1、先看我的测试Demo
#include <stdio.h>
#include <stdlib.h>int get_size(int *p)
{int size = sizeof(p);return size;
}int main()
{int a[6] = {1, 2, 3, 4, 5, 6};int b[] = {1, 2, 3, 4, 5, 6};int c[10] = {1, 2, 3, 4, 5, 6};int size_a = sizeof(a);int size_b = sizeof(b);int size_c = sizeof(c);printf("a size is %d\n", size_a);printf("b size is %d\n", size_b);printf("c size is %d\n", size_c);int size = get_size(a);printf("size is %d\n", size);printf("a is %d\n", a);printf("&a[0] is %d\n", &a[0]);printf("&a is %d\n", &a);printf("a + 1 is %d\n", a + 1);printf("&a[0] + 1 is %d\n", &a[0] + 1);printf("&a + 1 is %d\n", &a + 1);return 0;
}