title: Why is the dereference operator (*) also used to declare a pointer?
body: <p>I'm not sure if this is a proper programming question, but it's something that has always bothered me, and I wonder if I'm the only one.</p>
  
  <p>When initially learning C++, I understood the concept of references, but pointers had me confused. Why, you ask? Because of how you declare a pointer.</p>
  
  <p>Consider the following:</p>
  
  <pre><code>void foo(int* bar)
  {
  }
  
  
  int main()
  {
      int x = 5;
      int* y = NULL;
  
      y = &amp;x;
      *y = 15;     
      foo(y);
  
  }
  </code></pre>
  
  <p>The function <code>foo(int*)</code> takes an <code>int</code> pointer as parameter. Since I've declared <code>y</code> as <code>int</code> pointer, I can pass <code>y</code> to <code>foo</code>, but when first learning C++ I associated the <code>*</code> symbol with dereferencing, as such I figured a dereferenced <code>int</code> needed to be passed. I would try to pass <code>*y</code> into <code>foo</code>, which obviously doesn't work.</p>
  
  <p>Wouldn't it have been easier to have a separate operator for declaring a pointer? (or for dereferencing). For example:</p>
  
  <pre><code>void test(int@ x)
  {
  }
  </code></pre>