当前位置:网站首页>02.01-----The role of parameter reference "&"
02.01-----The role of parameter reference "&"
2022-08-05 05:24:00 【A long way to go】
The effect of parameters of the reference“ & ”
To modify parameters need to bring back,Then use quotation marks “&”
无参数的引用“ & ”
#include <iostream>
using namespace std;
void test(int x){
x=1024;
printf("test函数内部 x=%d\n",x);
}
int main(){
int x=1;
printf("调用test前 x=%d\n",x);
test(x);
printf("调用test后 x=%d\n",x);
}
调用test前 x=1
test函数内部 x=1024
调用test后 x=1
Using the parameters of reference“ & ”
#include <iostream>
using namespace std;
void test(int &x){
x=1024;
printf("test函数内部 x=%d\n",x);
}
int main(){
int x=1;
printf("调用test前 x=%d\n",x);
test(x);
printf("调用test后 x=%d\n",x);
}
调用test前 x=1
test函数内部 x=1024
调用test后 x=1024
边栏推荐
猜你喜欢

Matplotlib(二)—— 子图

span标签和p标签的区别

Reverse theory knowledge 4

Wise Force Deleter强制删除工具

【练一下1】糖尿病遗传风险检测挑战赛 【讯飞开放平台】

第5讲 使用pytorch实现线性回归

Structured light 3D reconstruction (1) Striped structured light 3D reconstruction

第三讲 Gradient Tutorial梯度下降与随机梯度下降

The software design experiment four bridge model experiment

【cesium】Load and locate 3D Tileset
随机推荐
Machine Learning (2) - Machine Learning Fundamentals
The difference between span tag and p
开发一套高容错分布式系统
span标签和p标签的区别
UVA10827
[WeChat applet] WXML template syntax - conditional rendering
Lecture 5 Using pytorch to implement linear regression
1068找到更多的硬币
Multi-threaded query results, add List collection
小白一枚各位大牛轻虐虐
02.01-----参数的引用的作用“ & ”
【过一下7】全连接神经网络视频第一节的笔记
数字_获取指定位数的小数
Lecture 4 Backpropagation Essays
ES6 生成器
Difference between for..in and for..of
2022杭电多校第一场01
Requests库部署与常用函数讲解
Error creating bean with name 'configDataContextRefresher' defined in class path resource
2022 Hangzhou Electric Multi-School 1st Session 01