某32位系统下, C++程序如下所示,sizeof 的值应为?
char str[] = "http://www.renren.com" //(21个字符) char *p = str ;
请计算
sizeof (str ) = ?//(1) sizeof (p) = ?//(2) void Foo (char str[100]){ sizeof(str) = ?//(3) } void *p = malloc(100); sizeof(p) = ?//(4)
char str[] = "http://www.renren.com" //(21个字符) char *p = str ;
sizeof (str ) = ?//(1) sizeof (p) = ?//(2) void Foo (char str[100]){ sizeof(str) = ?//(3) } void *p = malloc(100); sizeof(p) = ?//(4)
22, 22, 100, 100
4, 4, 4, 4
22, 4, 4, 4
22, 4, 100, 4
作为函数的形参传递时数组退化为指针