title: c++ function calling function not working
body: <p>I have 3 functions:</p>
  
  <ol>
  <li>First function takes an int a and prints the that number of dots.</li>
  <li>The second function takes an int b and prints that number of stars.</li>
  <li>The third function takes a and b and calls the dots function and stars function. When I call it in main, it returns 0 without any output.</li>
  </ol>
  
  <p>Each of the functions work fine on their own - why doesn't the third one work then?</p>
  
  <p>EDIT: Tried initializing i=0, code still compiles with the same result. Again, both functions dots() and stars() work fine when called on their own.</p>
  
  <pre><code>void dots(int a){
      for(int i; i&lt;a; i++){
          cout &lt;&lt; ".";
      }
  }
  void stars(int a){
      for(int i; i&lt;a; i++){
          cout &lt;&lt; "*";
      }
  }
  
  //(not working):
  void dotsstars(int a, int b){
      dots(a);
      stars(b);
  }
  
  int main(){
      dotsstars(5, 6);
  
      return 0;
  }
  </code></pre>