Following is the piece of code:
I a have a function:
Code:
void q21_transpose(int **array,int rows,int columns)
{
int temp,i,j;
for(i=0;i<rows;i++)
{
for(j=0;j<columns;j++)
{
temp = array[i][j]; //Exception is thrown here
array[j][i] = array[i][j];
array[j][i] = temp;
}
}
}
Code calling the function:
Code:
int a[3][3] = {{1,2,3},{4,5,6},{7,8,9}},**q21_result,i,j;
q21_transpose(a,3,3);
What is wrong with the above highlighted assignment statement?
It throws exception at assignment
Thanks in advance...