title: My program runs but I get some warnings that tell me the format %d can't go there
body: <p>I have to make a program which asks me to enter different values and then it has to print them on the screen. Aftar that, It asks me, &quot;which value of the vector you want to change?&quot; and I have to enter the number of the value and than the value itsself.</p>
  <p>When I run the program I get several warnings like this:</p>
  <p>&quot;warning: format '%d' expects argument of type 'int', but argument 6 has type 'int *' [-Wformat=]&quot;</p>
  <p>I don't know how to fix this, I tried using %p but it doesn't help.
  Any ideas?</p>
  <pre class="lang-c prettyprint-override"><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  
  #define MAX 5
  
  int main()
  {
      int intero = 0;
      int *p_int;
  
      int vettore[MAX] = {0};
      int *p_vet;
      int num = 0;
      int val = 0;
  
      char carattere = 0;
      char *p_car;
  
      p_int = &amp;intero;
      p_car = &amp;carattere;
      p_vet = vettore;
  
      printf(&quot;Enter an integer: &quot;);
      scanf (&quot;%d&quot;, &amp;intero);
      fflush (stdin);
  
      printf (&quot;\nEnter a character: &quot;);
      scanf(&quot;%c&quot;, &amp;carattere);
      fflush (stdin);
  
      for (int i=0; i&lt;MAX; i++)
      {
          printf(&quot;\nEnter integer n^%d of the vector: &quot;, i);
          scanf(&quot;%d&quot;, &amp;vettore[i]);
          fflush (stdin);
      }
  
      printf(&quot;\n\n\n&quot;);
  
      printf(&quot;Type\t\tDirect Value\t\tValue by Pointer\tDirect Position\tPosition by Pointer\n&quot;);
      printf(&quot;__________________________________________________________________________________________________________________\n\n&quot;);
      printf(&quot;Integer:\t\t%d\t\t\t%d\t\t\t\t%d\t\t\t\t%d\n\n&quot;, intero, *p_int, &amp;intero, p_int);
      printf(&quot;Character:\t%c\t\t\t%c\t\t\t\t%d\t\t\t\t%d\n\n&quot;, carattere, *p_car, &amp;carattere, p_car);
  
      for (int i=0; i&lt;MAX; i++)
      {
          printf(&quot;Integer n^%d:\t%d\t\t\t%d\t\t\t\t%d\t\t\t\t%d\n\n&quot;, i, vettore[i], *p_vet, &amp;vettore[i], p_vet);
          p_vet++;
      }
  
      p_vet = vettore;
  
      printf(&quot;\nEnter which value of the vector you want to change: &quot;);
      scanf(&quot;%d&quot;, &amp;num);
      fflush(stdin);
  
      printf(&quot;\nEnter now the value you want: &quot;);
      scanf(&quot;%d&quot;, &amp;val);
      fflush(stdin);
  
      *(p_vet + num) = val;
      printf(&quot;\n\n&quot;);
  
      for (int i=0; i&lt;MAX; i++)
      {
          printf(&quot;Integer n^%d:\t%d\t\t\t%d\t\t\t\t%d\t\t\t\t%d\n\n&quot;, i, vettore[i], *p_vet, &amp;vettore[i], p_vet);
          p_vet++;
      }
  
      return 0;
  }
  </code></pre>