sizeof和strlen的区别:
sizeof(int)=4;
char a[10]="abc";
sizeof(a)=10;
strlen(a)=4;
f(int *a[])
{
sizeof(a)=4;
//因为已经退入为指针
}
sizeof的值在编译时就已经确定,所以sizeof(x)可以用来创建数组,而strlen的值要在运行期才能确定;
char a[sizeof(int)];
原文:http://www.cnblogs.com/jone-liu/p/4953822.html