int x[10];
&x; //记录的是x的第一个数组
//通过指针和类 可以改变 函数传参
比如
cookies[10] = {1,2,3,5,4,5,6,};
//声明函数
int sum_arr(int cookies[]){}
int sum_arrr(int *cookies){}
sum_arr(cookies);
sum_arrr(cookies); //效果一样的
//cookies 表示的是首地址
this 是 C++ 中的一个关键字,也是一个 const 指针,它指向当前对象,通过它可以访问当前对象的所有成员。
所谓当前对象,是指正在使用的对象。例如对于stu.show();,stu 就是当前对象,this 就指向 stu。
指针.cppp
于 2022-11-13 20:17:38 首次发布