Formal Argument for int Array[x][y]?

Discussion in 'C Programming' started by erktek@gmail.com, Nov 18, 2005.

  1. Guest

    Hi!
    It is clear that when we try to pass a one dimentional array to a
    function
    we use int* such as


    void display(int *LocalAarray)
    {
    ......
    }

    int main(void)
    {
    int MainArray[3] = {1, 2, 3};

    display(MainArray);
    return 0;
    }
    name of the array is automaticly casted to (int*)
    but what is the case I want to use two dimensional array ?
    int main(void)
    {
    int MainArray[2][3] = {{1, 2, 3},
    {4,5,6}};

    display(MainArray);

    return 0;
    }

    what should be the formal parameter of display function?
    void display(int** Local Array) ? <-- Is it true?
     
    , Nov 18, 2005
    #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. Gil
    Replies:
    6
    Views:
    4,553
  2. Schnoffos
    Replies:
    2
    Views:
    1,219
    Martien Verbruggen
    Jun 27, 2003
  3. Hal Styli
    Replies:
    14
    Views:
    1,646
    Old Wolf
    Jan 20, 2004
  4. Replies:
    6
    Views:
    431
    Keith Thompson
    Nov 18, 2005
  5. Alain Spineux
    Replies:
    6
    Views:
    634
    Eric Sosman
    May 17, 2011
Loading...

Share This Page