sizeof an array function --sizeof(Array)

/// extern array variable
extern int array[];
printf(sizeof(array) );

/// the result is 4-- the pointer's size

/// only when array is defined in current file

int local_array[10] = {0};
printf(sizeof(local_array));
//the result is 4*10 = 40 

///

猜你喜欢

转载自blog.csdn.net/zztan/article/details/79914552