title: Reading data from a file and storing each line in an array?
body: <p>I have a file with lines of integers. I want to read each line into a slot in my array. I have the code below, but it does not work. I'm not sure if I'm on the right track. </p>
  
  <pre><code>void Read_Save() {
      ifstream in;
      int arr[100];
      string line;
      in.open("file.txt");
      while (in.peek() != EOF)
      {
          getline(in, line, '\n');
          strcpy(arr, line.c_str());
      }
      in.clear(); in.close();
  }
  </code></pre>