Re: Function terminology QUESTION

Discussion in 'C Programming' started by James Kuyper, Oct 13, 2013.

  1. James Kuyper

    James Kuyper Guest

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


    From section 3, "Terms, definitions, and symbols" in the C standard:
    "argument
    actual argument
    actual parameter (deprecated)
    expression in the comma-separated list bounded by the parentheses in a
    function call expression, or a sequence of preprocessing tokens in the
    comma-separated list bounded by the parentheses in a function-like macro
    invocation" (3.3p1)

    "parameter
    formal parameter
    formal argument (deprecated)
    object declared as part of a function declaration or definition that
    acquires a value on entry to the function, or an identifier from the
    comma-separated list bounded by the parentheses immediately following
    the macro name in a function-like macro definition" (3.16p1)

    Note that terms "actual parameter" and "formal argument" confuse the
    issue, which is why they are deprecated. I would also recommend against
    using "actual argument" or "formal parameter".

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


    The C standard does not use the term "subroutine", and it does not use
    the term "method" with that meaning. It just has functions, which can be
    used to implement sub-routines and methods. All arguments to C functions
    are passed by value. Passing by reference is emulated by passing around
    pointers, but those pointers are themselves passed by value.
    --
    James Kuyper
    James Kuyper, 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:
    290
    Gary Herron
    Dec 24, 2006
  2. Paul
    Replies:
    63
    Views:
    1,207
  3. Eric Sosman

    Re: Function terminology QUESTION

    Eric Sosman, Oct 13, 2013, in forum: C Programming
    Replies:
    0
    Views:
    140
    Eric Sosman
    Oct 13, 2013
  4. August Karlstrom

    Re: Function terminology QUESTION

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

    Re: Function terminology QUESTION

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

Share This Page