Code:
for (i=0;i<size;i++)
{
for (j=0;j<size;j++)
{
if(fscanf(ip_file,"%d",&sudoku[i][j])==1)
{
//copy to TempArr
TempArr[i][j]==sudoku[i][j];
}
else
{
perror ("fscanf failed on input file.\n");
// return error
}
}
}
Here I'd like to copy sudoku[][] to TempArr[][] but when I checked the values of TempArr[][], they are completely different. Why this is happening.
When I removed
Code:
if(fscanf(ip_file,"%d",&sudoku[i][j])==1)
, and replaced with TempArr[][], its working.
Why this is happening and how to handle this situation.