title: How to access to variable of parent scope in c++?
body: <p>Let's imagine I have piece of code like this:</p>
  
  <pre><code>#include &lt;iostream&gt;
  
  int main()
  {
  
      int a = 5;
      {
          int a = 12;
          std::cout &lt;&lt; a;
      }
  
      return 0;
  }
  </code></pre>
  
  <p>I want to cout <code>a==5</code> from outside scope, but <code>main::a</code> doesn't work surely. Is there any workaround?</p>