C++ function parameters: use a reference or a pointer (and then dereference)?

后端 未结 11 2218
臣服心动
臣服心动 2021-02-05 10:49

I was given some code in which some of the parameters are pointers, and then the pointers are dereferenced to provide values. I was concerned that the pointer dereferencing wou

11条回答
  •  粉色の甜心
    2021-02-05 11:01

    You should see the generated assembly code for the target machine... take into account that a function call is always done in constant time, and on actual machines that time is really negligible...

提交回复
热议问题