Kounista
Junior Member level 2
- Joined
- Jul 15, 2009
- Messages
- 22
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1,281
- Location
- Tunisia
- Activity points
- 1,500
Hi everyone,
I have a general question about code optimization for all the software experts here: I know that passing arguments by const instead of value is more efficient and allows us to avoid allocating a temporary local variable of the argument type. But is this always true? Or are there some cases when calling functions with constant arguments should be avoided? If so, is passing by pointer the most efficient way?
Thanks in advance and I hope my question is clear!
I have a general question about code optimization for all the software experts here: I know that passing arguments by const instead of value is more efficient and allows us to avoid allocating a temporary local variable of the argument type. But is this always true? Or are there some cases when calling functions with constant arguments should be avoided? If so, is passing by pointer the most efficient way?
Thanks in advance and I hope my question is clear!