title: How can I delete a line from a text file in C++?
body: <p>I want to delete a line of my text file without replacing it with " ".
  Just as a side note: my file has newlines. So I have more than one line (like a table)</p>
  
  <pre><code>void Data::delete_line(const string&amp; idNr) {
      ifstream list;
      string readFile, id;
      list.open("list.txt", ios::app);
  
      if (list.is_open()) {
          while (getline(list, readFile)) {
              int pos = readFile.find(';');
              id = readFile.substr(0, pos);
              if (idNr == id) {
                  //deleting the line here
              }
          }
      }
  
  }
  </code></pre>
  
  <p>I found <a href="https://stackoverflow.com/questions/26576714/deleting-specific-line-from-file">this question</a> but it does not solve my problem:</p>