1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

hi i am a new commer to this site

Discussion in 'C' started by akash 12, Jul 20, 2011.

  1. akash 12

    akash 12 New Member

    Joined:
    Jul 20, 2011
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    Guys i just to know how we can pass an array through function . if possible pls write a sufficient program for this
     
  2. DRK

    DRK New Member

    Joined:
    Apr 13, 2012
    Messages:
    44
    Likes Received:
    3
    Trophy Points:
    0
    Array as a function parameter is passed by its pointer.
    Code:
    element_type my_array[ARRAY_SIZE]; // array definition
    
    void fun(element_type *array) // function definition
    {
      // instructions
    }
    
    fun(my_array); // function call 
     

Share This Page