Passing array by value

后端 未结 4 1592
小鲜肉
小鲜肉 2021-01-03 11:41

Is it possible to pass an array by value to a C++ function?

If it is, how would I do that?

4条回答
  •  鱼传尺愫
    2021-01-03 12:26

    Yes, you can. You can implement it by using a pointer as the argument, but in the function body, you can use the copy mothord (the exact name I can't remember) to copy it.

提交回复
热议问题