c- format "%d" expects argument of type 'int *', but argument 3 has type int
<p>I'm new with C programming and I need to get images from two .dat files and compare if both of them are equal. The files first have the number of images, and then some images. I need to return 1 if all of the images are the same.</p>

<p>Pic of one of the .dat files:</p>

<p><a href="https://i.stack.imgur.com/TKysJ.png" rel="nofollow">F1.dat</a></p>

<p>The first 20 means 20 "groups" of images.
Then 3 4 would mean 3x4 matrix and the rest would be the matrix. The same with the other 19 matrices.</p>

<p>I need to go comparing the first matrix of the first file with the first one from the other file and so on.</p>

<p>This is the code I wrote:</p>

<pre><code>#include &lt;stdio.h&gt;
#include &lt;stdlib.h&gt;

struct irudia{
    int w,h;
    unsigned char im[16][16];
};

int berdinak (struct irudia *im1, struct irudia *im2){
int berdin = 1;
if ((im1-&gt;w != im2-&gt;w) || (im1-&gt;h != im2-&gt;h)){
    return 0;
}
for (int i = 0; i &lt; im1 -&gt; h; i++){
    for (int j = 0; j &lt; im1 -&gt; w; j++){
        if (im1-&gt;im[i][j] != im2-&gt;im[i][j]){
            berdin = 0;
        }
    }
}
return berdin;
}

int main (int argc, char *argv[]){
int n1, n2;
int berdin = 1;
struct irudia i1, i2;
if (argc != 3){
    printf("Errorea parametroetan. Programa amaitu da.\n");
    exit(-1);
}
FILE *fitx1 = fopen(argv[1], "r");
FILE *fitx2 = fopen(argv[2], "r");
fscanf(fitx1, "%d", &amp;n1);
fscanf(fitx2, "%d", &amp;n2);
if (n1 != n2){
    return 0;
}
struct irudia *p1 = &amp;i1;
struct irudia *p2 = &amp;i2;
while (!feof(fitx1) &amp;&amp; berdin == 1){
    fscanf (fitx1, "%d", &amp;i1.h);
    fscanf (fitx1, "%d", &amp;i1.w);
    fscanf (fitx2, "%d", &amp;i2.h);
    fscanf (fitx2, "%d", &amp;i2.w);
    for (int i = 0; i &lt; i1.h; i++){
        for (int j = 0; j &lt; i1.w; j++){
            fscanf (fitx1, "%d", (unsigned char)(i1.im[i][j]));
        }
    }
    for (int i = 0; i &lt; i2.h; i++){
        for (int j = 0; j &lt; i2.w; j++){
            fscanf (fitx2, "%d", (unsigned char)(i2.im[i][j]));
        }
    }
    berdin = berdinak (p1, p2);
}
    fclose (fitx1);
    fclose (fitx2);
    return berdin;
}
</code></pre>

<p>I don't need you to understand the code or anything like that. I need to know why I am getting a warning when I do</p>

<pre><code>fscanf (fitx1, "%d", (unsigned char)(i1.im[i][j]));
</code></pre>