PASSINAG A bidimansional array at a function
how do I pass as referance a bidimansional array ata function?
this
int a[1][2];
void f(int **b);
doesnt work ! type mismatch.
-i found this way ...
struct c
{
int *p[2];
} array;
voit initNewType()
{
array.p[0] = &(a[0][0]);
array.p[1] = &(a[0][1]);
}
void f(c *value)
{ //how do i move the array index thru the bidimansioal array?????
*((*value).p[i]+j); //value at a[j][i]....but there 's a mistake someone can help me?
//there's a simpler solution instead that using this mess?
}
main()
{ f(&array);
}
///there's a esyer way to pass by referance a duble array?
if you emailme to [email protected] i'll really apprciate it!
no need something more fine working
However your solution again doesent perform a by referance passing to the function but performs a copy of the passed array to the local array to the function and if the array passed ad declared in the function proptipe is quite huge time CPU computing an memory space is widely wasted!
That's not high performed coding...and sound really stupid!