I'm trying to compare data in a 2D array that represents a matrix. As it is a sparse matrix, I created the 2D array compactMatrix, that has the lines and columns where the value matrix entrance is not null.
I'm using this code to make the comparison:
if(compactMatrix[0][i] == compactMatrix[1][k] &&
compactMatrix[1][i] == compactMatrix[0][k]){
Do stuff...
}
Where i and k are the indexes I'm currently looking at in a forloop.
For you to know, I debugged and the value of compactMatrix[0][i] and compactMatrix[1][k]and compactMatrix[1][i] and compactMatrix[0][k] were indeed equal.
Tried to print the value using
j = compactMatrix[0][i];
l = compactMatrix[1][i];
printf("%i %i", &j, &l);
but it gives me the pointer address, I guess.
So, I want to know why is it returning false in that if clause and how to fix it properly.