title: Getting input from external files?
body: <p>I need to get very basic input from an external file in C++. I tried searching the internet a few times but nothing really applied to what I need. This would be a .txt file that the input it coming from, and it would be filled with lines like this:    </p>
  
  <p>131<br>
  241<br>
  371<br>
  481</p>
  
  <p>I have code already to manually get this input, and it looks like this:</p>
  
  <pre><code>using namespace std;
  //Gets the initial values from the user.
      int control=0;
      while (rowb!=0){
          cout &lt;&lt; "Row: ";
          cin &gt;&gt; rowb;
          cout &lt;&lt; "Column: ";
          cin &gt;&gt; columnb;
          cout &lt;&lt; "Number: ";
          cin &gt;&gt; numb;
          row[control]=rowb-1;
          column[control]=columnb-1;
          num[control]=numb;
          control++;
      }
  </code></pre>
  
  <p>This is part of a program that solves sudoko boards. The inputed numbers are the initial values that a sudoko board holds, and the user is inputing the row, column, and number that comes from a board.<br>
  What I need is to be able to create a .txt file with these numbers stored in rows so that I do not have to enter so many numbers. I have very little idea how to go about doing this. Mainly I'll only be using the txt file for testing my program as I move along with adding more code to it. It takes 150+ entered numbers within my program just to get a single board, and it takes a lot of time. Any accidentally wrong entered value is also a huge problem as I have to start again. So how would I get C++ to read a text file and use those numbers as input?</p>