title: What is the difference between scanf("%d", *p) and scanf("%d", p)?
body: <p>Pointers are a new thing for me and I'm struggling to understand it, but I won't give in and hopefully learn it.</p>
  
  <p>What would be the difference between <code>scanf ("%d", *p)</code> and <code>scanf ("%d", p)</code>?</p>
  
  <p>In examples I saw that if I want to input some value in a variable, I should use <code>scanf ("%d", p)</code>. That doesn't make sense to me. Shouldn't it be <code>scanf ("%d", *p)</code>?</p>
  
  <p>I interpret it as: "put some integer value where the pointer is pointing" and for instance it is pointing on variable <code>x</code> and then it should be <code>x = 10</code>, but it isn't. And how then to use <code>scanf()</code> and pointers to set values in an array?</p>
  
  <p>Where and what am I getting wrong? I'm trying to learn this using C language, since it is the one which I'm supposed to use in my class.     </p>
  
  <p>For example:</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  int main () {
      float x[10], *p;
      int i;
      p = &amp;x[0];
      for (i = 0; i &lt; 10; i++) {
          scanf("%d", p + i);
      }
      for (i = 0; i &lt; 10; i++) {
          printf("%d", *(p + i));
      }
      return 0;
  }
  </code></pre>
  
  <p>Why is only <code>p + i</code> in the first <code>for () {}</code> and <code>*(p + i)</code> in the second loop? I would put <code>*(p + i)</code> also in the first <code>for () {}</code>. <code>*(p + i)</code> to me is like: "to what the (p+i)th element is and make it equal some value". </p>