Differences between parameters vs arguments/parameters and arguments

Source: Internet
Author: User
In a word, Simply put: one of the two terms is used for function definition and the other for function calling ~

These two terms are sometimes loosely used interchangeably; in particle, "argument" is sometimes used in place of "parameter". Nevertheless, there is a difference.Properly, parameters appear in procedure definitions; arguments appear in procedure CILS.

A parameter is an intrinsic property of the procedure, encoded ded in its definition. for example, in rule versions, a minimal procedure to add two supplied integers together and calculate the sum total wowould need two parameters, one for each expected integer. in general, a procedure may be defined with any number of parameters, or no parameters at all. if a procedure has parameters, the part of its definition that specifies the parameters is called itsParameter List.

By contrast, the arguments are the values actually supplied to the procedure when it is called. unlike the parameters, which form an unchanging part of the procedure's definition, the arguments can, and often do, vary from call to call. each time a procedure is called, the part of the procedure call that specifies the arguments is calledArgument list.

Although parameters are also commonly referred to as arguments, arguments are more properly thought of as the actual values or references assigned to the parameter variables when the subroutine is called at run-time. when discussing code that is calling into a subroutine, any values or references passed into the subroutine are the arguments, and the place in the Code where these values or references are given isParameter List. When discussing the code inside the subroutine definition, the variables in the subroutine's parameter list are the parameters, while the values of the parameters at runtime are the arguments.

Extends programmers useParameterAndArgumentInterchangeably, depending on context to distinguish the meaning. The termFormal ParameterRefers to the variable as found in the function definition (Parameter), WhileActual ParameterRefers to the actual value passed (Argument).

Differences between parameters vs arguments/parameters and arguments

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.