Re: Function terminology QUESTION

Discussion in 'C Programming' started by Geoff, Oct 14, 2013.

  1. Geoff

    Geoff Guest

    On Sun, 13 Oct 2013 10:39:51 +0000 (UTC), rashan <>
    wrote:

    >Hello,
    >
    >Do you say there is a difference between " parameter " and " argument "
    >in as what is passed to C functions?
    >


    "Parameters" is the word used to describe the definitions of the
    variables the function uses to perform its task.

    "Arguments" is the word used to describe the values passed to the
    function when it is called.

    A function names its parameters in the definition:

    int
    func(float param1, int param2)
    {
    /* function body */
    }

    This function returns int and takes two parameters.


    A function receives its arguments when called.

    void caller ()
    {
    int ret;
    float val = 2.23;
    int i = 1;

    ret = func(val, i);
    /* do something with ret */

    }


    Parameters are the definitions of the arguments the function takes
    when it is called.

    In C, arguments are passed by value but this has nothing to do with
    the use of parameter and argument in this case.
    Geoff, Oct 14, 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:
    288
    Gary Herron
    Dec 24, 2006
  2. Paul
    Replies:
    63
    Views:
    1,197
  3. Eric Sosman

    Re: Function terminology QUESTION

    Eric Sosman, Oct 13, 2013, in forum: C Programming
    Replies:
    0
    Views:
    138
    Eric Sosman
    Oct 13, 2013
  4. James Kuyper

    Re: Function terminology QUESTION

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

    Re: Function terminology QUESTION

    August Karlstrom, Oct 13, 2013, in forum: C Programming
    Replies:
    1
    Views:
    150
    Keith Thompson
    Oct 13, 2013
Loading...

Share This Page