title: Why is this an error: static_cast<unsigned*>(&i)
body: <p>By following the rule of thumb to prefer <code>static_cast</code> or <code>dynamic_cast</code> before everything else, I wrote the following program:</p>
  
  <pre><code>int main(void)
  {
      int i = 0;
      unsigned *j = static_cast&lt;unsigned*&gt;(&amp;i);
      return 0;
  }
  </code></pre>
  
  <p>However, it does not even compile:</p>
  
  <pre><code>$ g++ --std=c++11 test5.cpp 
  test5.cpp: In function ‘int main()’:
  test5.cpp:4:44: error: invalid static_cast from type ‘int*’ to type ‘unsigned int*’
       unsigned *j = static_cast&lt;unsigned*&gt;(&amp;i);
                                              ^
  </code></pre>
  
  <p>Why is this wrong? What is the correct cast for this situation?</p>