当前位置:才华君>好好学习>考研>

笔试题(sizeof)

考研 阅读(2.55W)

以下为Windows NT下的32位C++程序,请计算sizeof的值(10分)

笔试题(sizeof)


char str[] = “Hello” ;

       char    *p = str ;
int n = 10;

请计算

sizeof (str ) = 6 (2分)

sizeof ( p ) = 4 (2分)

sizeof ( n ) = 4


void Func ( char str[100])

{

请计算

sizeof( str ) = 4 (2分)

}


void *p = malloc( 100 );

请计算

sizeof ( p ) = 4 (2分)