int a[20]; int len = sizeof(a)/sizeof(*a); //值为20,即数组长度为20 注:sizeof是一个操作符,sizeof的值在编译时确定 转载于:https://www.cnblogs.com/yibinpan/p/3311438.html