answersLogoWhite

0


Best Answer

Pass by value.

User Avatar

Wiki User

11y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: In what way is an argument passed by so it is not affected by a change of the content of the parameter value?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

What argument passes in a method that will reference the content and can change the variable in the method?

That is called passing an argument by reference.


What is difference between parameter and argument in java?

They are synonyms.Some people use the word 'argument' for the 'formal parameter' and 'parameter' for the 'actual parameter', others do on the other way around.PS:example for the formal parameters (function declaration):int myfun (const char *s, int p);example for the actual parameters (function calling):myfun ("Hello", 44);


What is the use of passing an argument by value?

Passing an argument by value means that the method that receives the argument can not change the value of the argument. Passing an argument by reference means that the method that receives the argument can change the value of the incoming argument, and the argument may be changed in the orignal calling method.


Explain the difference between an argument and a parameter Use a C plus plus program segment to illustrate your answer?

In C++ there is no such thing as a parameter, there are only arguments, both actual and formal. Some languages use the term parameter to mean a formal argument and argument to mean an actual argument, while others reverse the meanings completely. Some languages make no distinction at all and use the terms parameter and argument interchangeably. However, C++ is quite clear on this: actual arguments are the names that you pass to a function, while formal arguments are the names received by the function. Even so, you will still encounter incorrect usage of the terms parameter and arguments, even by C++ experts (myself included!) The following example code demonstrates the difference between an actual argument and a formal argument, as the terms apply in C++: int foo(int formal) { return(formal*2); } void bar(int& formal) { formal*=2; } int main() { int actual=1; actual = foo(actual); bar(actual); return(0); } The function foo() declares a formal argument by value while bar() declares a formal argument by reference. In main() we declare a variable with the name actual and pass this actual argument to both functions in turn. When we pass actual to foo(), the value of actual is assigned to formal. Since formal is a copy of actual, they are separate names with separate values (initially they will have the same value of course). Thus any changes made to formal will have no effect on actual, hence we must assign the return value from foo() to actual in main(), in order to record the change made by foo(). When we pass actual to bar(), a reference to actual is assigned to formal. A reference is simply an alternate name for the same argument, however the name actual is not visible to bar(), so they are still separate names, but they always have the same value. Thus any changes to formal will affect actual, thus there is no need to assign any return value to record the change.


Why does an investigator change the value of a variable parameter during in investigation?

Which factor does the investigator change during an investigation?

Related questions

What argument passes in a method that will reference the content and can change the variable in the method?

That is called passing an argument by reference.


Which parameter is not change when sound is goes air to water?

Speed is that parameter which doesn't change.


Does a parameter ever change for a set population?

No, a parameter never changes for a set population.


What is difference between parameter and argument in java?

They are synonyms.Some people use the word 'argument' for the 'formal parameter' and 'parameter' for the 'actual parameter', others do on the other way around.PS:example for the formal parameters (function declaration):int myfun (const char *s, int p);example for the actual parameters (function calling):myfun ("Hello", 44);


What is the use of passing an argument by value?

Passing an argument by value means that the method that receives the argument can not change the value of the argument. Passing an argument by reference means that the method that receives the argument can change the value of the incoming argument, and the argument may be changed in the orignal calling method.


What are system design parameter?

Which of the following is NOT a system design parameter? Human Systems Integration (HSI), Reliability and Maintainability, Standardization, DOTMLPF Change Recommendation


What is quality parameter?

A quality parameter is a measuring device used to measure rivers, lakes, and ground water. This device can measure the way these bodies of water change.


Why does an investigator change the value of a variable parameter during an investigation?

To find out what happens.


Explain the difference between an argument and a parameter Use a C plus plus program segment to illustrate your answer?

In C++ there is no such thing as a parameter, there are only arguments, both actual and formal. Some languages use the term parameter to mean a formal argument and argument to mean an actual argument, while others reverse the meanings completely. Some languages make no distinction at all and use the terms parameter and argument interchangeably. However, C++ is quite clear on this: actual arguments are the names that you pass to a function, while formal arguments are the names received by the function. Even so, you will still encounter incorrect usage of the terms parameter and arguments, even by C++ experts (myself included!) The following example code demonstrates the difference between an actual argument and a formal argument, as the terms apply in C++: int foo(int formal) { return(formal*2); } void bar(int& formal) { formal*=2; } int main() { int actual=1; actual = foo(actual); bar(actual); return(0); } The function foo() declares a formal argument by value while bar() declares a formal argument by reference. In main() we declare a variable with the name actual and pass this actual argument to both functions in turn. When we pass actual to foo(), the value of actual is assigned to formal. Since formal is a copy of actual, they are separate names with separate values (initially they will have the same value of course). Thus any changes made to formal will have no effect on actual, hence we must assign the return value from foo() to actual in main(), in order to record the change made by foo(). When we pass actual to bar(), a reference to actual is assigned to formal. A reference is simply an alternate name for the same argument, however the name actual is not visible to bar(), so they are still separate names, but they always have the same value. Thus any changes to formal will affect actual, thus there is no need to assign any return value to record the change.


Why does an investigator change the value of a variable parameter during in investigation?

Which factor does the investigator change during an investigation?


What is parameter is parameter is?

formal parameter is we accept in function body/defination actual parameter is we pass from calling function to function body. Ex : int a,b; void add (a,b) ; where a & b is actual parameter // calling function void add(int i,int j) where i & j are formal parameter // function body { } By Darshan Paliwal


What is the difference between a controlled parameter and a variable parameter?

controlled parameters the factor that stays the same in ALL groups variable parameters the factor(s) that change between control groups and variable groups