4

单选题 4 /66

某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)

参考答案

22, 22, 100, 100
4, 4, 4, 4
22, 4, 4, 4
22, 4, 100, 4