0

what actually happens in call by default value process?

23rd Jul 2016, 8:50 AM
Darsh Shah
Darsh Shah - avatar
7 Réponses
+ 1
No, defaulted parameters and references are two completely different things. Defaulted parameters are just giving a parameter a standard value, if not given in the call to the function. "Call by reference" is a way of passing a parameter. Defaulted parameters can be "call by reference" but they can also be "call by value". So you see, they are independent of each other. I give you that both things have to do with passing parameters to a function but that's where the similarity ends. Anyways, your question was about what happens, when a function with default parameters is called. As I assume that you mean the technical details and not just conceptually, I can't tell. I don't know this part of the standard well enough and there is a multitude of options of how a compiler could generate code for it.
23rd Jul 2016, 4:12 PM
Stefan
Stefan - avatar
0
"Call by value" or "default parameters "?
23rd Jul 2016, 10:57 AM
Stefan
Stefan - avatar
0
ok
23rd Jul 2016, 1:23 PM
Darsh Shah
Darsh Shah - avatar
0
"Ok" is not an answer to my question. Which of the both is it? Or is it a third thing you mean?
23rd Jul 2016, 3:44 PM
Stefan
Stefan - avatar
0
see call by default value is another process and it is allmost same as call by reference.
23rd Jul 2016, 3:48 PM
Darsh Shah
Darsh Shah - avatar
0
thanks a lot 👍
24th Jul 2016, 4:31 AM
Darsh Shah
Darsh Shah - avatar
0
No problem. 🙂
24th Jul 2016, 10:45 AM
Stefan
Stefan - avatar