Can someone either explain to me, or give me a good site to learn how to do the following?
If I have an 2d array..
int [2][3] = {1,2,3,4,5,6};
How do I pass the array into a function which will switch the rows?
ie... row 0 is now row 1 and row 1 is now row 0.
I know its something to do with pointers and double pointers, and I tried to read a few sites about them... but it just ended up confusing me more, none of them had any good examples.
I thought it would be something like this...
Code:
int array[2][3] = {1, 54, 98, 2, 75, 84};
int **temp1;
int **temp2;
int *t;
t = array[0][0];
*temp1 = array[1][0];
*temp2 = t;
Thanks for any help..