0

Does Anyone know how i can convert this 1D array (findArray) that checks for an element Into a function called 2Dfind that searches a 2D and pass each array to arrayfind(), to do the searching

```
int findArray(int A[], int n, int x)
{
for(int i = 0; i < n; i++)
if(A[i] == x)
return i;
else
return -1;
}
```

ive been told i dont need to use another for loop but im still unsure how to make this new 2Dfind Function

i tried this but i was told its wrong

```
int 2Dfind(int A[][], int &n, int &x)
{
for(int i = 0; i < n; i++)
{
for(int j=0; j < n[i]; j++)
{
if(A[i][j] == x)
return i,j;
else
return -1;
}
}
}
```

*Edited 6 Years Ago by Nick Evan*: Added code-tags