L
laclac01
Is there a way to pass a 2d array to a function in c++ with out having
to specifiy the number of elements in the array. Here is an example
array needs to have the [10][10] or at least
[][10]. is there a way i can make it so it
only needs [][]?
to specifiy the number of elements in the array. Here is an example
Code:
#include<iostream>
using namespace std;
int main()
{
int array[10][10];
fill(array,rows,cols);
return 0;
}
void fill(int array[10][10], rows,cols)
{
int i, j;
for(i=0;i<10;i++)
for(j=0;j<10;j++)
array[i][j]=0;
}
[][10]. is there a way i can make it so it
only needs [][]?