Original Post
I feel like an idiot! I can''t seem to pass a 2d array to a function?! Here''s my code (the relevant part anyways):
int myArray[4][4] =
{
{1, 2, 3, 4},
(5, 6, 7, 8},
(4, 3, 2, 1},
(8, 7, 6, 5},
}
void myFunc(int **array)
{
int i;
int j;
for(i = 0; i < 4; i++)
{
for(j = 0; j < 4; j++)
{
cout << array[i][j] << endl;
}
}
}
int main()
{
myFunc((int **)myArray);
return 0;
}
I''ve also tried ''*'' and ''&'' when passing my array into the function, but no luck. Any ideas? This seems so simple to me, but I am just having a brain fart or something! Thanks!