title: outFile C++ not writing to output text
body: <p>Down below is my incomplete program. I am having problems with writing to a text file. For example I want to write the number of snow days to a text file, but nothing shows up in the textfile when I debug in VS 2010. It does display my info and name, but nothing else works. It wont write anything after that. its NOT writing to a text file. </p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;iomanip&gt;
  #include &lt;string&gt;
  #include &lt;fstream&gt;
  
  using namespace std;
  
  const string INFORMATION = "College Class";
  const string MY_NAME = "Tom Hangler";
  
  int main(void)
  {
  
      ofstream outFile;
  
  
      int numberOfSnowDays;
      int greatestSnowDay;
      int dayNumber;
      double amounttOfSnow;
  
  
      outFile.open("Ex1Out.txt");
      outFile &lt;&lt; setw(51) &lt;&lt; INFORMATION &lt;&lt; endl &lt;&lt; setw(48) &lt;&lt; MY_NAME &lt;&lt; endl;
  
  
  
      cout &lt;&lt; "Please enter num of days it snowed: " &lt;&lt; endl;
      cin &gt;&gt; numberOfSnowDays;
      outFile &lt;&lt; setw(10) &lt;&lt; "Number of days of snow is: " &lt;&lt; setw(10) &lt;&lt; numberOfSnowDays;     
  
      int index;
      //Problem 1 for-loop
      for (index = 0; index &lt; numberOfSnowDays; index++)
      {   
          cout &lt;&lt; "Enter day: " &lt;&lt; endl;
          cin &gt;&gt; dayNumber;
          cout &lt;&lt; "Enter amount of snow: " &lt;&lt; endl;
          cin &gt;&gt; amountOfSnow;
  
      };
  
      return 0;   
  }
  </code></pre>
  
  <p>here is what my output displays:
  College Class (centered)
  Tom Hangler   (centered)</p>
  
  <p>If i try to write anything after this, Nothing is written ever to the output file. And the output text file IS in my VS project that contains my .cpp file. I added the text file to project. </p>