passing arguments.

Discussion in 'C' started by gurpreet guppi, Feb 8, 2012.

  1. gurpreet guppi

    gurpreet guppi New Member

    Joined:
    Oct 19, 2011
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    0
    why we pass parameters(arguments ) in functions?
    why we need it?
    plz help me.
     
  2. NewsBot

    NewsBot New Member

    Joined:
    Dec 2, 2008
    Messages:
    1,267
    Likes Received:
    3
    Trophy Points:
    0
    If you don't need just don't pass them because passing parameters depends on what your function want to be doing with those data passed.
     
  3. hobbyist

    hobbyist New Member

    Joined:
    Jan 7, 2012
    Messages:
    141
    Likes Received:
    0
    Trophy Points:
    0
    to go along with what shabbir stated, unless you're in the habit of using global variables, you need some mechanism to access a variable's value outside of the scope in which it was declared. The way to do that is to pass a variable as a parameter into a function.
     
  4. johnBMitchell

    johnBMitchell New Member

    Joined:
    Feb 17, 2011
    Messages:
    38
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    CA, USA
    Home Page:
    http://www.spinxwebdesign.com/
    Argument is a value either in form of integer or string which passes when a function called. It is not necessary to pass argument because it depends on a function which you define. It also depends on your program logic.
     

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