Q:

Assuming T is the name of a type, explain the difference between a function declared as void f(T) and void f(T&)

0

 Assuming T is the name of a type, explain the difference between a function declared as void f(T) and void f(T&).

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

`void f(T)` will pass the argument by value, which means in the function `f`, a copy of `T` will be made.

`void f(T&)` will pass the argument by reference, which means in the function `f`, the same variable defined in the caller is used.

 

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now