answersLogoWhite

0


Best Answer

The term parameter refers to any declaration within the parentheses following the function name in a function declaration or definition; the term argument refers to any expression within the parentheses of a function call.

1.parameter used in procedure defination

2.arguments used in procedure call

This example demonstrates the difference between a parameter and an argument:

void foo(int a, char b); //a and b are parameters,

here procedure is define

int main()

{

foo(5, 'a'); //5 and 'a' are arguments,

here procedure is called

return 0;

}

User Avatar

Wiki User

13y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

13y ago

I just had my teacher clarify kind of the same thing to me earlier, let's see if I can get this straight for you..

To keep it short, the parameters are what you are bringing in or, what you are handling with the function.

And the result is the variable or answer the function has found for the code that it did. (to my knowledge:) )

More In-Depth:

I think I can explain it better this way, so in this program code, we have:If GoodBet(intWager) Then . . .

lblResult.Text = "This is a good bet"

Else

lblResult.Text = "This is a bad bet"

Function GoodBet(ByVal TheBet As Integer) As Boolean If TheBet <=0 Then

MsgBox("Can't risk negative numbers", , "Bad Risk")

GoodBet = False . . . .

OR you could also have put: "Return = False"

That will do the same thing as GoodBet = False

So here we're using "ByVal" which means to get a COPY of TheBet, and "As Integer" means the variable(intRisk) will come in as an integer value.

When we say "As Boolean" that means we'll be returning a "TRUE" or "FALSE" to the If test. Because we said "GoodBet(intRisk)" the function connects it's "TheBet" variable with intRisk.

I hope this helped!! :D

Maybe someone else could chime in with more accurate info or a better explaination.

This answer is:
User Avatar

User Avatar

Wiki User

7y ago

In programming there is no difference. Some languages prefer you to use one or the other, however this is merely by convention; the terms are interchangeable and do not affect the meaning in any way. In programming, we use the terms formal argument and actual argument. The actual argument is the argument being passed to the function. The actual argument may be a named variable or a literal constant. The formal argument is the corresponding argument that is used by the function. When we pass an argument to a function, the actual argument's value is assigned to the formal argument of the function. This is known as pass by value. However, if we pass a memory address (by value), this is known as pass by reference.

In mathematics there is a subtle difference between the terms. Mathematical functions may accept any number of arguments composed of variables. However, a function may use additional variables that are not themselves passed as arguments to the function. These variables are known as the function's parameters. In programming, we would call these variables local variables rather than parameters.

This answer is:
User Avatar

User Avatar

Wiki User

11y ago

They are synonyms. They mean the same thing. The arguments of a function are its parameters and vice versa.

This answer is:
User Avatar

User Avatar

Wiki User

12y ago

Argument is nothing but give the value

Ex:

fun(5,10)

{

}

Parameter is that it have the declaration

Ex:

fun(int i,int j)

{

}

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What is the difference between argument and parameter?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

Difference between Bresenham and midpoint circle drawing algorithm?

what is difference between mid-point and bresenhams circle algorithm what is difference between mid-point and bresenhams circle algorithm bresenhams circle algorithm results in a much more smoother circle,comparred to midpoint circle algorithm..In mid point,decision parameter depends on previous decision parameter and corresponding pixels whereas in bresenham decision parameter only depends on previous decision parameter...


What is the difference between parameters and arguments in VB?

In programming languages, a parameter and an argument are the same thing; there is no actual difference between the two. Although a few languages do differentiate between an actual argument and a formal argument by calling one a parameter and the other an argument (or vice versa), the terms are universally interchangeable. That is; there is no single definition that applies to any one language, including Visual Basic. The language may have a convention, but there's no reason to follow that convention. Personally, I prefer the term argument and use the terms formal argument and actual argument whenever I need to specifically differentiate one from the other. In this way I can refer to them in a consistent but language-agnostic manner. Only a Pedant would argue that the terms parameter and argument have a specific meaning to a specific language, even when the creators of that language use the terms interchangeably themselves. To clarify, an actual argument is the argument being passed to a function while a formal argument is the argument that is used by the function. The two will always have the same value, but they are not the same argument. For instance, consider the following function definition: f (int a) { print a*2 } Whether we regard 'a' as being a parameter or an argument is immaterial -- it is a formal argument or formal parameter, whichever you prefer. The meaning is clarified by using the word "formal". Now consider the calling code: b = 42 f (b) Here, b is the actual argument (or actual parameter) being passed to the function f. Note that a and b are not the same variable or reference. That alone means there is no reason to differentiate them; the meaning of argument or parameter is implied by the context alone. It doesn't matter whether the function uses pass by value or pass by reference semantics. When passing arguments by value, a is simply a copy of b (independent variables with the same value). When passing by reference, a refers to the same memory address as b (a is an alias for b). In either case, the function uses the formal argument named a while the calling code uses the actual argument named b. In other words, the names are only accessible from within the scope in which they are declared, even if they refer to the same memory address. Of course, a function may pass one of its formal arguments to another function. Thus with respect to the calling function, its formal argument becomes an actual argument to the function being called.


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);


In what way is an argument passed by so it is not affected by a change of the content of the parameter value?

Pass by value.


What is a variable that is used within a function?

If the variable is declared within the function body, it is a local variable, one that is local to the function. Local variables fall from scope when the function returns, they are only accessible within the function. However, local variables can be returned by value, which creates an automatic variable that is returned to the caller. If the caller does not store the return value, the automatic variable falls from scope when the expression containing the function call ends. However, the expression may evaluate the return value without storing it. Note that functions cannot return local variables by reference since the local variable falls from scope when the function returns. If the variable is passed as an argument to the function, then the variable is a parameter of the function. Arguments may be passed by value or by reference, depending upon the function signature. Passing by value means the function parameter is a copy of the argument (if the argument is an object, the object's copy constructor is invoked automatically). Thus any changes made to the parameter within the function are not reflected in the argument that was originally passed, and the parameter will fall from scope when the function returns. However, the value of the parameter can be returned as previously explained. Passing by reference means the function parameter refers directly to the argument that was passed. Thus any changes made to the parameter are reflected in the argument. Parameters that are declared as constant references assure the caller that the reference's immutable members will not be altered by the function. If the parameter is a non-const reference but the caller does not wish changes to be reflected in the argument, the caller should pass a copy of the argument instead.

Related questions

What is the difference between statistics and parameter?

What is the difference between statistics and parameter


What is the difference between ref and out parameters?

Output parameters are similar to reference parameters, except that they transfer data out of the method rather than into it. Reference parameter copies the reference to the memory location of an argument into the formal parameter. This means that changes made to the parameter affect the argument.


Difference between single parameter sensitivity and multiple parameter sensitivity?

Difference between single parameter sensitivity and multiple parameter sensitivity is that in multiple parameter sensitivity,defined parameters cannot be measured with a high degree of accuracy in the field or in the laboratory.


What is the difference between principal argument and argument of a complex number?

PRINCIPAL ARGUMENT = ARGUMENT + 2nPI arg(Z) = Arg (Z) + 2nPI


Which parameter best defines the primary difference between weather and climate?

time


What is difference between parameter and arbitrary constant?

A parameter is a variable which takes different values and, as it does, it affects the values of some other variable or variables.


What is bias an experiment?

The bias is the difference between the expected value of a parameter and the true value.


Difference between Bresenham and midpoint circle drawing algorithm?

what is difference between mid-point and bresenhams circle algorithm what is difference between mid-point and bresenhams circle algorithm bresenhams circle algorithm results in a much more smoother circle,comparred to midpoint circle algorithm..In mid point,decision parameter depends on previous decision parameter and corresponding pixels whereas in bresenham decision parameter only depends on previous decision parameter...


What is the difference between parameters and arguments in VB?

In programming languages, a parameter and an argument are the same thing; there is no actual difference between the two. Although a few languages do differentiate between an actual argument and a formal argument by calling one a parameter and the other an argument (or vice versa), the terms are universally interchangeable. That is; there is no single definition that applies to any one language, including Visual Basic. The language may have a convention, but there's no reason to follow that convention. Personally, I prefer the term argument and use the terms formal argument and actual argument whenever I need to specifically differentiate one from the other. In this way I can refer to them in a consistent but language-agnostic manner. Only a Pedant would argue that the terms parameter and argument have a specific meaning to a specific language, even when the creators of that language use the terms interchangeably themselves. To clarify, an actual argument is the argument being passed to a function while a formal argument is the argument that is used by the function. The two will always have the same value, but they are not the same argument. For instance, consider the following function definition: f (int a) { print a*2 } Whether we regard 'a' as being a parameter or an argument is immaterial -- it is a formal argument or formal parameter, whichever you prefer. The meaning is clarified by using the word "formal". Now consider the calling code: b = 42 f (b) Here, b is the actual argument (or actual parameter) being passed to the function f. Note that a and b are not the same variable or reference. That alone means there is no reason to differentiate them; the meaning of argument or parameter is implied by the context alone. It doesn't matter whether the function uses pass by value or pass by reference semantics. When passing arguments by value, a is simply a copy of b (independent variables with the same value). When passing by reference, a refers to the same memory address as b (a is an alias for b). In either case, the function uses the formal argument named a while the calling code uses the actual argument named b. In other words, the names are only accessible from within the scope in which they are declared, even if they refer to the same memory address. Of course, a function may pass one of its formal arguments to another function. Thus with respect to the calling function, its formal argument becomes an actual argument to the function being called.


What is the term used for the variable that receives an argument that is passed into a module?

parameter


What is the term used for the variable that receives an argument that passed into a module?

parameter


What is the term used for the variable that receives an argument that pass into a module?

parameter