Description
The concept of parameter passing is critical in writing and maintaining software. Passing arguments is a standard method used in all programming languages.
Explanation & Answer
Thank you for the opportunity to help you with your question!
Thank you for the opportunity to help you with your question!
Two ways to pass arguments
- Pass by value
- pass by reference
let me explain it with an example
Say I want to share a web page with you.
If I tell you the URL, I'm passing by reference. You can use that URL to see the same web page I can see. If that page is changed, we both see the changes. If you delete the URL, all you're doing is destroying your reference to that page - you're not deleting the actual page itself.
If I print out the page and give you the printout, I'm passing by value. Your page is a disconnected copy of the original. You won't see any subsequent changes, and any changes that you make (e.g. scribbling on your printout) will not show up on the original page. If you destroy the printout, you have actually destroyed your copy of the object - but the original web page remains intact.
Please let me know if you need any clarification. I'm always happy to answer your questions.Please let me know if you need any clarification. I'm always happy to answer your questions.
Review
Review
24/7 Homework Help
Stuck on a homework question? Our verified tutors can answer all questions, from basic math to advanced rocket science!
Similar Content
Related Tags
Where the Crawdads Sing
by Delia Owens
The Great Gatsby
by Francis Scott Key Fitzgerald
The Good Earth
by Pearl S. Buck
Fools Crow
by James Welch
Uncle Tom's Cabin
by Harriet Beecher Stowe
Becoming
by Michelle Obama
Murder on the Orient Express
by Agatha Christie
Steppenwolf
by Hermann Hesse
The Joy Luck Club
by Amy Tan