如何在不使用循环的情况下减少指针数组中的值? [英] How to Decrement the values in Pointer array without using loop?

查看:80
本文介绍了如何在不使用循环的情况下减少指针数组中的值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在不使用循环的情况下减少整数指针数组的所有值(单次)。

是否可能,'C'中有任何函数?

I want to decrement all the values (in single time) of integer pointer array without using loop.
Is it possible, Any function is there in 'C'?

推荐答案

没有。 C中没有标准函数来递减数组的每个元素。

循环是显而易见的选择:理论上可以使用递归函数来实现这一点,但在实践中它只是隐藏循环并引入新级别的不必要的复杂性,相关的性能下降和堆栈使用量的大幅增加。
No. There is no standard function in C to decrement every element of an array.
A loop is the obvious choice: it would in theory be possible to do this with a recursive function, but in practice that is just hiding the loop and introducing a new level of unnecessary complication, an associated drop in performance and a vast increase in stack usage.


这篇关于如何在不使用循环的情况下减少指针数组中的值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆