2-D arrays & function

I am not sure how to pass a 2-D array through when calling it in main. Could anyone provide some insight. I looked through references, but everything I have tried has taken away errors for that section only to put errors somewhere else. I thought it should be passed by references/pointers. Btw please ignore the efficiency of the code. I will use for loops to condense after getting the program to work.
Last edited on
following link explains how you can pass 2D arrays as parameters.
http://www.cplusplus.com/doc/tutorial/arrays/
1
2
3
4
5
6
7
8
9
10
11
12
13
void PrintArray(int[10][10] arr)
{
    for (int i = 0; i < 10; ++i)
        for (int j = 0; j < 10; ++j)
            std::cout << arr[i][j];
}

int main()
{
    int arr[10][10] = {0};

    PrintArray(arr);
}
Topic archived. No new replies allowed.