#include<stdio.h> void fun1(int *num){ num[0]=123; printf("sizeof(num)=%lu\n",sizeof(num)); printf("num = %p,num+1 = %p \n",num,num+1); } void fun2(int num[400]){ num[0]=123; // printf("sizeof(num)=%lu\n",sizeof(num)); printf("num = %p,num+1 = %p \n",num,num+1); } int main(){ int arr[400]={0}; printf("sizeof(arr)=%lu\n",sizeof(arr)); printf("arr=%p,arr+1=%p\n",arr,arr+1); printf("arr[0] = %p\n",&arr[0]); fun2(arr); return 0; }
sizeof(arr)=1600 arr=0x7ffd549cc0c0,arr+1=0x7ffd549cc0c4 arr[0] = 0x7ffd549cc0c0 num = 0x7ffd549cc0c0,num+1 = 0x7ffd549cc0c4
标签:arr,函数,int,lu,num,printf,sizeof From: https://www.cnblogs.com/qingjiawen/p/16886258.html