ok, so I'm writing here 2 version of the function - one calling the matrix (matrix [4][4]) and the other don't - why doesn't it work?
Code:
int swich_col (int matrix,int col1,int col2)
{
int tmp[4];
for (int i=0;i<4;i++)
tmp[i]=matrix[i][col1];
for (int i=0;i<4;i++)
matrix[i][col1]=matrix[i][col2];
for (int i=0;i<4;i++)
matrix[i][col2]=tmp[i];
}
the second one
Code:
int swich_col (int col1,int col2)
{
int tmp[4];
for (int i=0;i<4;i++)
tmp[i]=matrix[i][col1];
for (int i=0;i<4;i++)
matrix[i][col1]=matrix[i][col2];
for (int i=0;i<4;i++)
matrix[i][col2]=tmp[i];
}
the error I get is in the compilation is :
[Error] invalid conversion from 'int (*)[4]' to 'int' [-fpermissive]