title: How to share a variable between two functions in C?
body: <p>In C, suppose var1 is a variable in foo1() and foo2() wants to access var1, however, foo1() doesn't call foo2(), so we can't pass it by parameter. At the same time, only foo1() and foo2() will access it, so I wouldn't like to declare it as global variable. It will be similar with the "friend semantics" in c++, is there any way to implement this in C?</p>
  
  <pre><code>void foo1() {
    ... 
    var1;
    ....
  }
  
  
  void foo2() {
   ...
   how to access var1?
   ...
  }
  </code></pre>