Is there a way to make passing by reference, and passing by value explicit in the function call?

前端 未结 7 1516
北荒
北荒 2021-02-18 13:43

If you were to look at this code,

int x = 0;
function(x);
std::cout << x << \'\\n\';

you would not be able to verify through any me

相关标签:
7条回答
  • 2021-02-18 14:25

    That is the whole point of pass-by-reference -- that syntactically don't need to do anything different from passing by value.

    0 讨论(0)
提交回复
热议问题