title: Accessing the variable inside anonymous namespace (c++)
body: <p>I have following code and I don't know how can I access the x inside the anonymous namespace in this setting. Please tell me how?</p>
  
  <pre><code>#include &lt;iostream&gt;
  
  int x = 10;
  
  namespace
  {
      int x = 20;
  }
  
  int main(int x, char* y[])
  {
      {
          int x = 30; // most recently defined
          std::cout &lt;&lt; x &lt;&lt; std::endl; // 30, local
          std::cout &lt;&lt; ::x &lt;&lt; std::endl; // 10, global
          // how can I access the x inside the anonymous namespace?
      }
  
      return 0;
  }
  </code></pre>