printf( "i's address is %p\n", &i );
printf( "j's address is %p\n", &j );
}
void b()
{
int x;
int y;
printf( "x's address is %p\n", &x );
printf( "y's address is %p\n", &y );
}
int main( void )
{
a();
b();
return( 0 );
}
输出为:
i's address is 0xbfc8bd24
j's address is 0xbfc8bd20
x's address is 0xbfc8bd24
y's address is 0xbfc8bd20 提高内存利用率,一个调用完,调另一个。
大家好: 有这样一个问题和我想象的不一样,问题如下: 代码: #include
int main( void ) { int i; int j; int a[10];
printf( "i's address is %p\n", &i ); printf( "j's address is %p\n", &j );
printf( "a's address is %p\n", a );
for( i = 0; i < 10; i++ ) { printf( "a[%d]'s address is %p\n", i, &a[i] ); }
return( 0 ); }
输出如下: i's address is 0xbfa76f60 j's address is 0xbfa76f5c a's address is 0xbfa76f34 a[0]'s address is 0xbfa76f34 a[1]'s address is 0xbfa76f38 a[2]'s address is 0xbfa76f3c a[3]'s address is 0xbfa76f40
a[4]'s address is 0xbfa76f44 a[5]'s address is 0xbfa76f48 a[6]'s address is 0xbfa76f4c a[7]'s address is 0xbfa76f50 a[8]'s address is 0xbfa76f54 a[9]'s address is 0xbfa76f58