求字符型数组的长度可以用sizeof()和strlen()来直接求,但求整型数组长度却要用程序来完成
#include <iostream.h>
void main()
{ int a[]={1,2,3,4,5,6,78,9,85,56,1}; int m=sizeof(a); int n=sizeof(int); int v=m/n; cout<<m<<","<<n<<","<<v<<"\t"; cout<<endl;
}