Look at this piece of code.. In this I am taking input from a file and assigning to an array sudoku[][].. and simultaneously assigning those values to TempArr[][] (another array)..
But when I checked the values of TempArr[][] after assigning, there aren't same as in sudoku[][].
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
}
}
}
So, when I replaced "sudoku[][]" with "TempArr[][]", its working..
i.e., if(fscanf(ip_file,"%d",&TempArr[i][j])==1)
Why this is happening and how do I handle this situation ?
-Wunused-value(or-Wall) with gcc, but otherwise ... not so much. However, it's a good point to make - thanks, editing.