title: " :: " before a variable name c++
body: <pre><code>#include &lt;iostream&gt;
  
  using namespace std;
  
  int d = 10;
  
  int main()
  {
      int d = 20;
  
      {
          int d = 30;
          cout &lt;&lt; d &lt;&lt; endl &lt;&lt; ::d; // what does it mean?
      }
  
      return 0;
  }
  </code></pre>
  
  <p>output is:</p>
  
  <blockquote>
    <p>30<br>
    10</p>
  </blockquote>
  
  <p><strong>I don't understand why "<code>::d</code>" gives 10? Can someone explain it to me please?</strong> </p>