level 3
#include <iostream>
using namespace std ;
void func ( int * p ) ;
int main()
{ int x = 20 ;
func( &x ) ;
cout << "x = " << x << endl ;
}
void func ( int * p )
{ int a = 10 ;
*p += a ;
p = &a;
*p = *p + a ;
cout << "*p = " << *p << endl ;
cout << "a = " << a << endl ;
}
2012年08月16日 09点08分
1
level 10
int a = 10 ;
*p += a ;
所以 x 为 30
2012年08月16日 09点08分
3
x和*p和a是什么关系
2012年08月16日 10点08分