title: Two functions variables in to a single function
body: <p>I have two variables in two different functions, I'd like to store them in the third function without using global variables.
  How to do it?</p>
  
  <p>something like this</p>
  
  <pre><code>void function1() { 
    a = 1;
    b = 2;
  }
  
  void function2() {
    c = 3;
    d = 4;
  }
  
  void function3 () {
    cout &lt;&lt; a;  
    cout &lt;&lt; b;  
    cout &lt;&lt; c;  
    cout &lt;&lt; d;  
  }
  </code></pre>