// TASK C1.1: Explain the purpose of the '&' in a parameter.
// TASK C1.2: Explain what the program would do if the '&' was omitted in
// the initialiseStack() function header,
Problem.
// TASK C1.1:Explain the purpose of the '&' in a parameter.
// TASK C1.2: Explain what the program would do if the '&' was omitted in
// the initialiseStack() function header,
Remark. I suppose that it is C++ question, as in Action Script ‘&’ meansconcecatnation of the parameters in URL.
Solution.
An ampersand sign (&), known as referenceoperator, returns the address ofthe variable.
Hence when the argument of the function is &variable, then we pass theaddress of the variable. Thereforeif we modify the variable in the body of the function, then variable will be
modified, as a global variable. If sign is omitted, then variable will be
modified, as a local variable.
Need a fast expert's response?
Submit order
and get a quick answer at the best price
for any assignment or question with DETAILED EXPLANATIONS!
Learn more about our help with Assignments:
Adobe Flash