Saturday, July 23, 2016

Difference What is the difference between Parameter and Argument in c/c++ function description :-)

What is it :-)

    Firstly, we must notice what we often call is Parameter Variable rather than Argument Variable, while we call Argument Value.

    Secondly, Personally, there is a comparative relation between Parameter and Argument. Rather, this is really a context related notion.

    Thirdly, Personally, Parameter is the abstract of the Argument.

    <with consideration of C/C++ function . C++ template >

    ______________________________________________________________
    Followed below are cited material.
    []
    The term goes far back beyond computers. It's been used in astronomy to denote "a piece of information" at least since Chaucer, who used the term in his Treatise on the Astrolabe, to denote the information you get from the almanac for the locations of planets. These are the inputs to calculations to derive where the planet will be at any given date.

    It probably dates back to Latin meanings of argumentum that denote "proof" or "evidence". From astronomy it was adopted by mathematicians who used it for any kind of input to a calculation, and was standard by the 19th century. Computer people adopted it from them. 
    [Arguments](maybe definition or something)
    Parameters and arguments


    ...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.

    --wikipedia


    [Arguments]
    Argument is often used in the sense of "actual argument" vs. "formal parameter".
    The formal parameter is what's given in the function declaration/definition/prototype, the actual argument is what's passed when calling the function, an instance of a formal parameter, if you will. 

    --stackoverflow

    [Arguments]
    A parameter is the variable which is part of the method’s signature (method declaration). An argument is an expression used when calling the method. 

    --stackoverflow

    [Arguments ]
    function parameter (sometimes called a formal parameter) is a variable declared in the function declaration:
    An argument (sometimes called an actual parameter) is the value that is passed to the function by the caller:
    When a function is called, all of the parameters of the function are created as variables, and the value of the arguments are copied into the parameters. For example:
    When foo() is called with arguments 6 and 7, foo’s parameter x is created and assigned the value of 6, and foo’s parameter y is created and assigned the value of 7.
    Even though parameters are not declared inside the function block, function parameters have local scope. This means that they are created when the function is invoked, and are destroyed when the function block terminates:


--7.1-Function parameters and arguments



No comments:

Post a Comment