title: C++, What is difference between static local variable(method) vs global(file) variable?
body: <ol>
  <li>A local <code>static</code> variable is created once and the method will go out of scope, but the <code>static</code> variable is not destroyed and it will live in memory until the program ends.</li>
  <li>A global <code>static</code> variable live in memory until the program ends.</li>
  </ol>
  <p>So what is difference between local and global <code>static</code> variables?</p>
  <p>When should we use local <code>static</code> variables and global <code>static</code> variables?</p>