Page 1 of 1

Which statement best explains why arguments to functions such as swap must be passed by reference rather than by value?

Posted: Mon May 02, 2022 12:07 pm
by answerhappygod
Which Statement Best Explains Why Arguments To Functions Such As Swap Must Be Passed By Reference Rather Than By Value 1
Which Statement Best Explains Why Arguments To Functions Such As Swap Must Be Passed By Reference Rather Than By Value 1 (30.96 KiB) Viewed 21 times
Which statement best explains why arguments to functions such as swap must be passed by reference rather than by value? Select one: Changes made to value parameters affect only a copy of the arguments. Passing references allows the function to change the original variables. Functions like swap can be written without using references, so arguments may be passed by value. Passing variables by value only works for non-primitive types. Passing references allows any type to be used. Declaring the parameters as references allows the function to be used with arbitrary expressions in addition to variables. ооо