(...) as the function input parameters.

Discussion in 'C' started by aspguy, Feb 11, 2006.

  1. aspguy

    aspguy New Member

    Joined:
    May 2, 2005
    Messages:
    58
    Likes Received:
    1
    Trophy Points:
    0
    When i declare a function in C , with (...) in the input area, how do I refer to these variable in the function ??
     
  2. coderzone

    coderzone Super Moderator

    Joined:
    Jul 25, 2004
    Messages:
    736
    Likes Received:
    38
    Trophy Points:
    28
    (...) in any function means that the function has variable no of parameters and so the parameters can be determined by the First parameter of the argument list. The best example of such function is printf.

    You can get the argument passed to the function using the combination of va_arg, va_list, va_start and va_end. va_arg can give you each successive arguments in va_list.The list must be initialized by calling va_start() before any calls to va_arg(). The list must be finalized by calling va_end().
     
  3. aspguy

    aspguy New Member

    Joined:
    May 2, 2005
    Messages:
    58
    Likes Received:
    1
    Trophy Points:
    0
    I am still waiting for the reply from the Experts.
     
  4. aspguy

    aspguy New Member

    Joined:
    May 2, 2005
    Messages:
    58
    Likes Received:
    1
    Trophy Points:
    0
    Ohh Thanks for the Reply Coderzone and probably we visited the thread almost at the same time and submitted the post just after you posted.
     
  5. coderzone

    coderzone Super Moderator

    Joined:
    Jul 25, 2004
    Messages:
    736
    Likes Received:
    38
    Trophy Points:
    28
    It Looks like.
    Also you should give more than 3 and half hours for a reply.
     
  6. aspguy

    aspguy New Member

    Joined:
    May 2, 2005
    Messages:
    58
    Likes Received:
    1
    Trophy Points:
    0
    Yeah I agree.
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice