当前位置:网站首页>c语言函数形参自增自减情况分析
c语言函数形参自增自减情况分析
2022-07-04 19:56:00 【hugo33】
在看前人留下的代码时看到了这样的函数:
当时就在想这个性参数传进去之后的值是什么呢?有点没想明白,后面查阅了这篇文章大致就明白了:
https://blog.csdn.net/salman_tan/article/details/86168767
如果形参uiSendNoAck的初值为0,那么在传进去之后,使用该值的时候,应该是该变量自增之前的值,也就是0, 但是如果将该变量的地址传进去,也就是传&uiSendNoAck,那么使用该变量就是自增之后的值,也就是1。我们可以这么理解,形参传进去之后会有一个临时变量产生,该临时变量的值就是该形参传递时候的值,传递完了之后该形参才自增。因此在函数里面使用这个值是自增前的,使用该变量的地址,就是自增之后的。
边栏推荐
- How to solve the problem that win11 cannot write the value to the registry key?
- Stack: how to realize the judgment of valid brackets?
- 6月“墨力原创作者计划”获奖名单公布!邀您共话国产数据库
- render函数与虚拟dom
- Alibaba testers use UI automated testing to achieve element positioning
- heatmap.js图片热点热力图插件
- nmap扫描
- word中插入图片后,图片上方有一空行,且删除后布局变乱
- 哈希表、哈希函数、布隆过滤器、一致性哈希
- ACM组合计数入门
猜你喜欢

字节测试工程师十年经验直击UI 自动化测试痛点

电脑怎么保存网页到桌面上使用

【观察】联想:3X(1+N)智慧办公解决方案,释放办公生产力“乘数效应”

js 3D爆炸碎片图片切换js特效

Flet tutorial 04 basic introduction to filledtonalbutton (tutorial includes source code)

Advantages of RFID warehouse management system solution

二叉树的四种遍历方式以及中序后序、前序中序、前序后序、层序创建二叉树【专为力扣刷题而打造】

Reinforcement learning - learning notes 2 | value learning

电脑共享打印机拒绝访问要怎么办

哈希表、哈希函数、布隆过滤器、一致性哈希
随机推荐
Quelques suggestions pour la conception de l'interface
阿里测试师用UI自动化测试实现元素定位
卷积神经网络在深度学习中新发展的5篇论文推荐
word中插入圖片後,圖片上方有一空行,且删除後布局變亂
Flet tutorial 06 basic introduction to textbutton (tutorial includes source code)
From automation to digital twins, what can Tupo do?
Après l'insertion de l'image dans le mot, il y a une ligne vide au - dessus de l'image, et la disposition est désordonnée après la suppression
JS卡牌样式倒计时天数
What is the development of block hash quiz game system? Hash quiz game system development (case mature)
After inserting a picture into word, there is a blank line above the picture, and the layout changes after deletion
Explication détaillée du mécanisme de distribution des événements d'entrée multimodes
go defer的使用说明
看腾讯大老如何做接口自动化测试
基于OpenCV haarcascades的对象检测
Win11怎么搜索无线显示器?Win11查找无线显示器设备的方法
What if the WiFi of win11 system always drops? Solution of WiFi total drop in win11 system
仿ps样式js网页涂鸦板插件
LeetCode 8. String conversion integer (ATOI)
LeetCode 871. Minimum refueling times
Golang中UTF编码和字符集