"Functions" Please respond to the following:

Computer Science
Tutor: None Selected Time limit: 1 Day

Imagine you are the lead PHP programmer for a small retailer. Describe the difference between passing a parameter to a function by value versus by reference to newly hired developers. Provide an example of each to support your response.

Jan 18th, 2015

passing a parameter by value makes the copy of the original parameter to be sent and stores the value of this copied value into the variable of function being called. When the function where parameter is passed exits its instructions, the copy of the variable is destroyed and no change it done to the original value of the variable. for example: 

Sort( int x); 

here sort is a function called where x is the parameter passed by value, now consider the implementation of sort function: 

Sort( int p )

{

-----------

when sort will complete itself, the copy of x which will be stored in p will be destroyed and original value of x remains as it is. 

Jan 18th, 2015

Are you studying on the go? Check out our FREE app and post questions on the fly!
Download on the
App Store
...
Jan 18th, 2015
...
Jan 18th, 2015
Dec 10th, 2016
check_circle
Mark as Final Answer
check_circle
Unmark as Final Answer
check_circle
Final Answer

Secure Information

Content will be erased after question is completed.

check_circle
Final Answer