当前位置:网站首页>c语言函数形参自增自减情况分析
c语言函数形参自增自减情况分析
2022-07-04 19:56:00 【hugo33】
在看前人留下的代码时看到了这样的函数:
当时就在想这个性参数传进去之后的值是什么呢?有点没想明白,后面查阅了这篇文章大致就明白了:
https://blog.csdn.net/salman_tan/article/details/86168767
如果形参uiSendNoAck的初值为0,那么在传进去之后,使用该值的时候,应该是该变量自增之前的值,也就是0, 但是如果将该变量的地址传进去,也就是传&uiSendNoAck,那么使用该变量就是自增之后的值,也就是1。我们可以这么理解,形参传进去之后会有一个临时变量产生,该临时变量的值就是该形参传递时候的值,传递完了之后该形参才自增。因此在函数里面使用这个值是自增前的,使用该变量的地址,就是自增之后的。
边栏推荐
- 奏响青春的乐章
- 浏览器渲染页面过程
- Flet tutorial 06 basic introduction to textbutton (tutorial includes source code)
- What are the functional modules of RFID warehouse management system solution
- 二叉树的四种遍历方式以及中序后序、前序中序、前序后序、层序创建二叉树【专为力扣刷题而打造】
- Jekins initialization password not found or not found
- Jiuqi ny8b062d MCU specification /datasheet
- 网络命名空间
- Common verification rules of form components -1 (continuously updating ~)
- LeetCode 7. Integer inversion
猜你喜欢
Leetcode+ 81 - 85 monotone stack topic
Some suggestions for interface design
网络命名空间
RFID仓库管理系统解决方案有哪些功能模块
Ten years' experience of byte test engineer directly hits the pain point of UI automation test
What if win11u disk refuses access? An effective solution to win11u disk access denial
【1200. 最小絕對差】
uniapp 富文本编辑器使用
Automatic generation of interface automatic test cases by actual operation
五子棋 上班摸鱼工具 可局域网/人机
随机推荐
五子棋 上班摸鱼工具 可局域网/人机
Reinforcement learning - learning notes 2 | value learning
多模输入事件分发机制详解
软件开发过中的采购
[observation] Lenovo: 3x (1+n) smart office solution, releasing the "multiplier effect" of office productivity
易周金融 | Q1保险行业活跃人数8688.67万人 19家支付机构牌照被注销
idea插件
Vue cleans up the keepalive cache scheme in a timely manner
[1200. Minimum absolute difference]
语义化标签的优势和块级行内元素
Hands on deep learning (III) -- convolutional neural network CNN
Ten years' experience of byte test engineer directly hits the pain point of UI automation test
WinCC7.5 SP1如何通过交叉索引来寻找变量及其位置?
LeetCode 7. 整数反转
Sword finger offer II 80-100 (continuous update)
LeetCode 8. String conversion integer (ATOI)
Flet tutorial 07 basic introduction to popupmenubutton (tutorial includes source code)
RFID仓储管理系统解决方案的优点
【1200. 最小绝对差】
Managed service network: application architecture evolution in the cloud native Era