Re: Function terminology QUESTION

Discussion in 'C Programming' started by Eric Sosman, Oct 13, 2013.

  1. Eric Sosman

    Eric Sosman Guest

    On 10/13/2013 6:39 AM, rashan wrote:
    > Hello,
    >
    > Do you say there is a difference between " parameter " and " argument "
    > in as what is passed to C functions?


    A function's parameters are the names inside the ( ) at the
    start of the function's definition. They behave just like local
    variables of the function, except that they have already been
    given values before the function begins to execute.[*]

    The arguments in a function call are the expressions that
    provide the initial values for the parameters of the called
    function.

    Illustration:

    int isEven(int number) {
    return number % 2 == 0;
    }
    ...
    int x = isEven(33);
    int y = isEven(x - 57);
    int z = isEven(f(x, y));

    In the function definition, `number' is a parameter. In the
    three function calls, `33' and `x - 57' and `f(x, y)' are
    arguments, each providing a value for the parameter `number'.

    [*] Functions with variable-length argument lists don't
    quite fit this explanation: The "..." objects are "parameters,"
    but they don't have names.

    > Would one be for functions and another for sub/method or so? Or ByRef/
    > ByVal?


    I don't understand your question.

    --
    Eric Sosman
    d
     
    Eric Sosman, Oct 13, 2013
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    2
    Views:
    308
    Gary Herron
    Dec 24, 2006
  2. Paul
    Replies:
    63
    Views:
    1,314
  3. James Kuyper

    Re: Function terminology QUESTION

    James Kuyper, Oct 13, 2013, in forum: C Programming
    Replies:
    0
    Views:
    170
    James Kuyper
    Oct 13, 2013
  4. August Karlstrom

    Re: Function terminology QUESTION

    August Karlstrom, Oct 13, 2013, in forum: C Programming
    Replies:
    1
    Views:
    181
    Keith Thompson
    Oct 13, 2013
  5. Les Cargill

    Re: Function terminology QUESTION

    Les Cargill, Oct 13, 2013, in forum: C Programming
    Replies:
    17
    Views:
    282
    Ben Bacarisse
    Oct 18, 2013
Loading...

Share This Page