title: Scanf - varaible per reference VS parameter per reference
body: <p>I have a little knot in my head. I was just trying to explain to someone, why a little program uses pointers the way it does, and then she asked me about a different way, which should (to my knowledge) work, but doesn't.
  Here's the code that works:</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  
  void inputNums(double *valOne, double *secVal)
  {
      printf("Enter your first number: ");
      scanf("%lf", valOne);
  
      printf("Enter your second number: ");
      scanf("%lf", secVal);
  }
  
  void sum(double valOne, double secVal )
  {
      double result = valOne + secVal;
      printf("The sum is: %.2f\n", result);
  }
  
  
  int main()
  {
      double numOne;
      double numTwo;
  
      inputNums(&amp;numOne, &amp;numTwo);
      sum(numOne, numTwo);
      return 0;
  }
  </code></pre>
  
  <p>And here's the code that doesn't, but I don't get why:</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  
  void inputNums(double valOne, double secVal)
  {
      printf("Enter your first number: ");
      scanf("%lf", &amp;valOne);
  
      printf("Enter your second number: ");
      scanf("%lf", &amp;secVal);
  }
  
  void sum(double valOne, double secVal )
  {
      double result = valOne + secVal;
      printf("The sum is: %.2f\n", result);
  }
  
  
  int main()
  {
      double numOne;
      double numTwo;
  
      inputNums(numOne, numTwo);
      sum(numOne, numTwo);
      return 0;
  }
  </code></pre>
  
  <p>I know it's something really simple, but for the love of god, I can't figure it out. Thanks guys :)</p>