title: Can I access static variables inside a function from outside
body: <p>C/C++: Can I access static variables inside a function from outside? For example:</p>
  
  <pre><code>#include &lt;iostream&gt;
  using namespace std;
  
  void f()
  {
      static int count = 3;
      cout &lt;&lt; count &lt;&lt; endl;
  }
  
  int main(int argc, char** argv)
  {
      f::count = 5;   // apparently this is an invalid syntax.
      f();
  
      return 0;
  }
  </code></pre>