title: warning: format ‘%d’ expects argument of type ‘int’, but argument 3 has type ‘int *’
body: <p>when I compile my code it shows me 3 warnings:</p>
  
  <pre><code>warning: format ‘%d’ expects argument of type ‘int’, but argument 3 has type ‘int *’ 
  warning: format ‘%d’ expects argument of type ‘int’, but argument 3 has type ‘int *’
   warning: format ‘%hhu’ expects argument of type ‘int’, but argument 3 has type ‘unsigned char *’ 
  </code></pre>
  
  <p>Here's the code:</p>
  
  <pre><code>typedef struct
  {
  int c; 
  int l; 
  unsigned char **matrizPixels; 
  } PGM;
  
   void salvaPGM(PGM *img, char* saida)
  
   {
  int i,j;
  
  FILE *arq;
  
  arq = fopen(saida,"w");
  
  fprintf(arq,"P2\n");
  fprintf(arq,"%d ", &amp;img-&gt;c);
  fprintf(arq,"%d ", &amp;img-&gt;l);
  fprintf(arq,"255\n");
  
  for(i = 0; i++; i &lt; img-&gt;l )
  {
      for (j = 0; j++; j &lt; img-&gt;c)
      {
          fprintf(arq,"%hhu ",&amp;img-&gt;matrizPixels[i][j]);
      }
       fprintf(arq,"\n");
  }
  
     fclose (arq);
   }
  </code></pre>