当前位置:网站首页>c语言函数形参自增自减情况分析
c语言函数形参自增自减情况分析
2022-07-04 19:56:00 【hugo33】
在看前人留下的代码时看到了这样的函数:
当时就在想这个性参数传进去之后的值是什么呢?有点没想明白,后面查阅了这篇文章大致就明白了:
https://blog.csdn.net/salman_tan/article/details/86168767
如果形参uiSendNoAck的初值为0,那么在传进去之后,使用该值的时候,应该是该变量自增之前的值,也就是0, 但是如果将该变量的地址传进去,也就是传&uiSendNoAck,那么使用该变量就是自增之后的值,也就是1。我们可以这么理解,形参传进去之后会有一个临时变量产生,该临时变量的值就是该形参传递时候的值,传递完了之后该形参才自增。因此在函数里面使用这个值是自增前的,使用该变量的地址,就是自增之后的。
边栏推荐
- Ten years' experience of byte test engineer directly hits the pain point of UI automation test
- Why is TCP three handshakes and four waves
- 记录线上bug解决list(未完待续7/4)
- 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
- BFC interview Brief
- go defer的使用说明
- Explication détaillée du mécanisme de distribution des événements d'entrée multimodes
- Cdga | six principles that data governance has to adhere to
- Managed service network: application architecture evolution in the cloud native Era
- Pytorch---使用Pytorch实现LinkNet进行语义分割
猜你喜欢

PS竖排英文和数字文字怎么改变方向(变竖直显示)

How does win11 search for wireless displays? Win11 method of finding wireless display device

6月“墨力原创作者计划”获奖名单公布!邀您共话国产数据库

In the face of the same complex test task, why can the elder sort out the solution quickly? Ali's ten-year test engineers showed their skills

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

五子棋 上班摸鱼工具 可局域网/人机

黄金k线图中的三角形有几种?

Advantages of RFID warehouse management system solution

HWiNFO硬件检测工具v7.26绿色版
![[observation] Lenovo: 3x (1+n) smart office solution, releasing the](/img/e4/f660461c42eb81ab8c94fd87503a83.png)
[observation] Lenovo: 3x (1+n) smart office solution, releasing the "multiplier effect" of office productivity
随机推荐
托管式服务网络:云原生时代的应用体系架构进化
电脑怎么保存网页到桌面上使用
LeetCode 8. 字符串转换整数 (atoi)
[solution] paddlepaddle 2 X call static graph mode
【观察】联想:3X(1+N)智慧办公解决方案,释放办公生产力“乘数效应”
MySQL statement execution details
语义化标签的优势和块级行内元素
6月“墨力原创作者计划”获奖名单公布!邀您共话国产数据库
多模输入事件分发机制详解
The concept and application of hash table
《动手学深度学习》(三) -- 卷积神经网络 CNN
[1200. Minimum absolute difference]
二叉树的四种遍历方式以及中序后序、前序中序、前序后序、层序创建二叉树【专为力扣刷题而打造】
Stack: how to realize the judgment of valid brackets?
GVM use
Summary of the mistakes in the use of qpainter in QT gobang man-machine game
[Shenbo introduction] VI How to contact your favorite doctoral tutor
LeetCode 8. String conversion integer (ATOI)
GVM使用
[observation] Lenovo: 3x (1+n) smart office solution, releasing the "multiplier effect" of office productivity