2241| 5
|
单片机STM32上用递归好吗 |
1金钱
最佳答案递归在C语言里可能还比较神奇,转到汇编就是个循环,都依赖分支(branch),跟循环没太多的区别。
所以,我的建议:如果能用递归,尽量用递归(能用的判断就是递归函数是否会耗尽系统资源,比如函数中临时变量的分配是否会因为递归过深导致耗尽ram之类)。
| ||
He who fights with monsters should look to it that he himself does not become a monster, when you gaze long into the abyss, the abyss also gazes into you.
过于执着就会陷入其中,迷失自己,困住自己。 |
||
| ||
| ||
我的开源链接 https://github.com/ShuifaHe/STM32.git 请关注,点赞支持哦。
|
||
| ||
| ||
| ||
|手机版|OpenEdv-开源电子网
( 粤ICP备12000418号-1 )
GMT+8, 2025-6-15 13:35
Powered by OpenEdv-开源电子网
© 2001-2030 OpenEdv-开源电子网