#include<iostream>
#include<string>
#include<math.h>
using namespace std;
void func(double *pd, int &ri)//*pd就是取x的地址上的值,就是x的值,以达到引用的作用,不可用变量接收,如果实参是变量的话,可以使用引用接收
{
ri = 100;
*pd = 1000;
}
int main()
{
double x=0;
int y=1;
func(&x,y);//&x就是将x的地址传过去
cout << x << " " << y << endl;
return 0;
}
引用&x就是取的x的地址;
而*p是什么?
*p是将地址上的内容取下来!