1.指针部分
编译器总是要为函数的每个参数创建临时副本。
查看指针的地址:
#include<iostream>
using namespace std;
void test(int *p,int a)
{
cout<<"p address is"<<&p<<endl;
}
int main()
{
int i=34;
int *str;
str=&i;
cout<<"str address is"<<&str<<endl;
test(str,i);
return 0;
}
输出结果:
str address is0012FF40
p address is0012FEEC
Press any key to continue