title: set value of variable in main function using a void function
body: <p>Why does <code>num1</code>'s value equal 0? I do not understand. How come passing <code>num1</code> into the <code>getScore</code> function and using <code>cin</code> does not change the value? How can I change its value based on what is <code>cin</code> to <code>score</code>. </p>
  
  <pre><code>#include &lt;iostream&gt;
  using namespace std;
  
  void getScore(double);
  
  int main(int argc, const char * argv[]) {
      double num1;
      getScore(num1);
      cout &lt;&lt; "NUM 1 got set to " &lt;&lt; num1 &lt;&lt; endl;
      return 0;
  }
  
  void getScore(double score) {
      cout &lt;&lt; "whats the score";
      cin &gt;&gt; score;
      cout &lt;&lt; "num is " &lt;&lt; score &lt;&lt; endl;
  }
  </code></pre>