Skip to main content

Differences Between Parameters and Arguments

Sự khác nhau giữa Parameter và Arguments

Wiki said:

The terms parameter and argument are sometimes loosely used interchangeably, and the context is used to distinguish the meaning. The term parameter (sometimes called formal parameter) is often used to refer to the variable as found in the function definition, while argument (sometimes called actual parameter) refers to the actual input passed. For example, if one defines a function as def f(x): ..., then x is the parameter, while if it called by a = ...; f(a) then a is the argument.

Basic concept:

argument is actual parameter
parameter is formal parameter

Example:

Ta có prototype của 1 hàm: void  Func(int x)
Thì x ở đây gọi là parameter
Trong chương trình ta gọi hàm Func(10). Thì 10 ở đây chính là argument

Read more:

http://en.wikipedia.org/wiki/Parameter_(computer_programming)

Comments