What is the primary advantage of passing parameters by reference over passing them by value? 

  • Reduced memory usage 
  • Faster program execution 
  • Modifying the actual variable 
  • Ensuring data privacy
Passing parameters by reference allows for direct access to the original memory location, eliminating the need for copying data. This reduces memory overhead and can enhance the performance of the program. While options 2 and 3 can also be benefits of passing by reference, the primary advantage is the reduction of memory usage.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *