I have a function that looks like this:
void swapRows(int row_1, int row_2, double **matrix, int n, int m)
{
double arrTemp = (double *)malloc(m * sizeof(double));
int i;
for(i = 0; i < m; i++)
{
arrTemp[i] = matrix[row_1][i];
*matrix[row_1][i] = matrix[row_2][i];
}
for(i = 0; i < m; i++)
{
*matrix[row_2][i] = arrTemp[i];
}
}
I tried dereferencing the array using two stars and a single star but can not figure it out. I don't want to store it in another array and return it VIA a double function, I need to return it from this void function. I am just swapping rows in the array and need to return the modified array to the main function.